Loading the data

setwd("d:/my/documents/UvA/Advanced Corporate Finance/Assignment 2")
data1 <- read.delim("group_project_data.txt",stringsAsFactors = F)
data1$gvkey<-as.factor(data1$gvkey)
data1<-data1[!duplicated(data1[c("gvkey","year")]),]

#names(data1)
library(estout)
library(plm)
library(psych)

1. Desciption of what it means for a company to be financially constrained. Why might such firms save some of their cash holdings

2. Create variable that represent financial constraint of lack of it using the data provided.

data1$rating_constraint<- as.numeric((!grepl(("BBB|A"),data1$credit_rating)))
dataConstraint <- data1[data1$rating_constraint ==1 ,] # creting separate datasets
dataNotConstraint <- data1[data1$rating_constraint ==0 ,]

3. Create variables that measure corporate investment, investment opportunities and cashflows. The variables should be ‘scaled’, i.e. divided by total assets.

#creating ne variables and winsorizing them
data1$capex_scaled <-  winsor(data1$capital_expenditures/data1$total_assets,na.rm=T,trim=.01)
data1$Qratio <- winsor((data1$market_value + data1$long_term_debt)/data1$total_assets,na.rm=T,trim=.01)
data1$cashflows_scaled <- winsor(data1$cashflows/data1$total_assets,na.rm=T,trim=.01)
data1$cash_scaled <- winsor(data1$cash/data1$total_assets,na.rm=T,trim=.01)

4. Running regressions of investment variable on investment opps and cashflows

model.1panel <- plm(capex_scaled ~ Qratio + cashflows_scaled, data=data1, model="within", effect  = "time")
model.1cross_sec <- lm(capex_scaled ~ Qratio + cashflows_scaled, data=data1)
model.1panelCon <- plm(capex_scaled ~ Qratio + cashflows_scaled, data=dataConstraint, model="within", effect  = "time")
model.1panelNotCon <- plm(capex_scaled ~ Qratio + cashflows_scaled, data=dataNotConstraint, model="within", effect  = "time")
model.1panelModerate <- plm(capex_scaled ~ Qratio + cashflows_scaled, data=dataModerate, model="within", effect  = "time")
dep var ‘investment’ panel reg normal OLS unconstrained firms constrained firms
Qratio 0.00255*** 0.00248*** -0.00581 0.00303***
(0.00074) (0.00071) (0.0038) (8e-04)
cashflows_scaled 0.06319*** 0.06297*** 0.1563*** 0.06148***
(0.01161) (0.01123) (0.05219) (0.01277)
(Intercept) 0.05289***
(0.00213)
R^2 0.01934 0.01859 0.02685 0.02044
adj.R^2 0.01769 0.01791 0.02042 0.01836
N 2892 2892 472 2420
Standard errors in parentheses

5. Describe one econometric problem and how it can bias the obtained estimates

6. Running regressions of cash holdings variable on investment opps and cashflows

model.2panel <- plm(cash_scaled ~ Qratio + cashflows_scaled, data=data1, model="within", effect ="time")
model.2cross_sec <- lm(cash_scaled ~ Qratio + cashflows_scaled, data=data1)
model.2panelCon <- plm(cash_scaled ~ Qratio + cashflows_scaled, data=dataConstraint, model="within", effect  = "time")
model.2panelNotCon <- plm(cash_scaled ~ Qratio + cashflows_scaled, data=dataNotConstraint, model="within", effect  = "time")
dep var ‘cash’ panel reg normal OLS unconstrained firms constarined firms
Qratio 0.02884*** 0.02898*** 0.0072* 0.02832***
(0.00137) (0.00133) (0.0043) (0.0015)
cashflows_scaled 0.00758 -0.00361 0.15614*** 0.03853
(0.02145) (0.02111) (0.05905) (0.02391)
(Intercept) 0.06092***
(0.00398)
R^2 0.1491 0.14527 0.08795 0.14704
adj.R^2 0.13657 0.14468 0.0675 0.13231
N 2928 2928 473 2455
Standard errors in parentheses

Appendix. Using KZ index to divide companies

#creating a KZindex variable
data1$KZindex <- -1.002*data1$cashflows + .283*((data1$market_value + data1$long_term_debt)/data1$total_assets) + 3.139*data1$long_term_debt - 39.368*data1$dividends - 1.315*data1$cash

dataWithoutNA <- data1[!is.na(data1$KZindex),]

dataConstraint <- dataWithoutNA[(dataWithoutNA$KZindex< quantile(dataWithoutNA$KZindex,.3)),]
dataNotConstraint <- dataWithoutNA[(dataWithoutNA$KZindex> quantile(dataWithoutNA$KZindex,.7,na.rm=T)),]
dataModerate <- dataWithoutNA[((dataWithoutNA$KZindex< quantile(dataWithoutNA$KZindex,.7,na.rm=T)) & (dataWithoutNA$KZindex> quantile(dataWithoutNA$KZindex,.3,na.rm=T))),]
dep var investment panel reg normal OLS constarined firms moderately constrained not constrained
Qratio 0.00255*** 0.00248*** -0.00101 0.00394*** -0.00501
(0.00074) (0.00071) (0.00124) (0.00107) (0.00342)
cashflows_scaled 0.06319*** 0.06297*** 0.22505*** 0.00784 0.30512***
(0.01161) (0.01123) (0.02227) (0.01709) (0.04699)
(Intercept) 0.05289***
(0.00213)
R^2 0.01934 0.01859 0.14039 0.01444 0.068
adj.R^2 0.01769 0.01791 0.11148 0.01203 0.05395
N 2892 2892 874 1137 852
Standard errors in parentheses