Essays in Firm Responses to Demand and Competition Shocks