Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Case-Study-1-Codes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Case 1_Dimagiba Patia

2024-07-02

library(readxl)

## Warning: package ’readxl’ was built under R version 4.3.3

case1dataset <- read_excel("FINARTS Case Study 1 Dataset-1.xls")


View(case1dataset)

#1.A) The coefficient of -0.0023 for Profit Margin (Profmarg) indicates that, holding all other variables
constant, a 1 unit increase in profit margin corresponds to a 0.23% decrease in the CEO’s salary under
Independent Variable 2. Similarly, for Independent Variable 3, a corresponding 1 unit increase in profit
margin leads to a 0.22% decrease in the CEO’s salary, with all other variables held constant.
#1.B) The z statistic for log market value is 0.112 divided by 0.05, which equals 2.24. Since this z value is
higher than the critical value of 1.96, it indicates that the market value has a significant impact.
#2(a)

single.house <- subset(case1dataset, fsize == 1)


sum(single.house$fsize)

## [1] 2017

#The dataset includes 2017 single-person households.


#2(b)

fit.case1dataset <- lm(nettfa ~ inc + age, data = single.house)


summary(fit.case1dataset)

##
## Call:
## lm(formula = nettfa ~ inc + age, data = single.house)
##
## Residuals:
## Min 1Q Median 3Q Max
## -179.95 -14.16 -3.42 6.03 1113.94
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -43.03981 4.08039 -10.548 <2e-16 ***
## inc 0.79932 0.05973 13.382 <2e-16 ***
## age 0.84266 0.09202 9.158 <2e-16 ***
## ---

1
## Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1
##
## Residual standard error: 44.68 on 2014 degrees of freedom
## Multiple R-squared: 0.1193, Adjusted R-squared: 0.1185
## F-statistic: 136.5 on 2 and 2014 DF, p-value: < 2.2e-16

#The statistically significant positive coefficient indicates that an increase in both age and income corre-
sponds to a rise in net financial wealth within the dataset, despite the coefficient’s modest magnitude.
#2(c)

fit.case1dataset1 <- lm(nettfa~inc, data = single.house)


summary(fit.case1dataset1)

##
## Call:
## lm(formula = nettfa ~ inc, data = single.house)
##
## Residuals:
## Min 1Q Median 3Q Max
## -185.12 -12.85 -4.85 1.78 1112.66
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -10.5709 2.0607 -5.13 3.18e-07 ***
## inc 0.8207 0.0609 13.48 < 2e-16 ***
## ---
## Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1
##
## Residual standard error: 45.59 on 2015 degrees of freedom
## Multiple R-squared: 0.08267, Adjusted R-squared: 0.08222
## F-statistic: 181.6 on 1 and 2015 DF, p-value: < 2.2e-16

#In contrast to part b, where both age and income were considered in the model, the estimated coefficient
in part c remains similar, suggesting a consistent relationship between income and net financial wealth.
However, the significant change in intercept indicates that age plays a crucial role in determining the baseline
level of net financial wealth. By focusing solely on income in part c, the model may overlook age-related
factors that contribute to variations in net financial wealth, thereby explaining the observed difference in
intercepts between the two models.
#IMPORT RETURN SHEET

returndata <- read_excel("FINARTS Case Study 1 Dataset-1.xls",


sheet = "return")
View(returndata)

#3(a)

model1 <- lm(return~dkr+eps+netinc+salary, data=returndata)


summary(model1)

##
## Call:

2
## lm(formula = return ~ dkr + eps + netinc + salary, data = returndata)
##
## Residuals:
## Min 1Q Median 3Q Max
## -88.629 -25.421 -4.215 18.326 124.627
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -14.370212 6.893616 -2.085 0.039 *
## dkr 0.320544 0.200911 1.595 0.113
## eps 0.042699 0.078138 0.546 0.586
## netinc -0.005109 0.004675 -1.093 0.276
## salary 0.003499 0.002194 1.595 0.113
## ---
## Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1
##
## Residual standard error: 39.19 on 137 degrees of freedom
## Multiple R-squared: 0.03948, Adjusted R-squared: 0.01143
## F-statistic: 1.408 on 4 and 137 DF, p-value: 0.2347

anova(model1)

## Analysis of Variance Table


##
## Response: return
## Df Sum Sq Mean Sq F value Pr(>F)
## dkr 1 3079 3078.9 2.0043 0.1591
## eps 1 608 607.9 0.3958 0.5303
## netinc 1 1053 1053.2 0.6856 0.4091
## salary 1 3909 3909.3 2.5449 0.1130
## Residuals 137 210447 1536.1

The equation shows how a return of a company’s holding if a stock


is estimated based on several factors. These factors include the
company’s market value (dkr), earnings per share (eps), net in-
come, and employee salaries.
#Return = -14.37 + 0.32dkr + 0.04eps -0.0051netinc +0.0035salary #Std errors = (6.89), (0.2), (0.078),
(0.0046), (0.0021)
#The standard errors, which measure the accuracy of these estimates, are provided in parentheses for each
coefficient in the same order as the variables mentioned. #None of the four variables—debt to capital ratio,
earnings per share, net income, and salary—show statistically significant effects. The F-values associated
with these variables are 1.59, 0.53, 0.4, and 0.11, respectively.
#3(b)

model2 <- lm(return ~dkr+eps+log(netinc)+log(salary), returndata )


summary(model2)

##

3
## Call:
## lm(formula = return ~ dkr + eps + log(netinc) + log(salary),
## data = returndata)
##
## Residuals:
## Min 1Q Median 3Q Max
## -80.402 -26.729 -4.223 19.475 126.948
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -36.29933 39.37380 -0.922 0.358
## dkr 0.32658 0.20265 1.612 0.109
## eps 0.06854 0.08035 0.853 0.395
## log(netinc) -4.74530 3.38566 -1.402 0.163
## log(salary) 7.24181 6.31251 1.147 0.253
##
## Residual standard error: 39.32 on 137 degrees of freedom
## Multiple R-squared: 0.03304, Adjusted R-squared: 0.004812
## F-statistic: 1.17 on 4 and 137 DF, p-value: 0.3266

#The equation estimates return based on several factors: market value (dkr), earnings per share (eps),
logarithm of net income, and logarithm of salary.
#Return = -36.29 + 0.32dkr + 0.06eps -4.74 log(netinc) +7.24log(salary) #Std errors = (39.37),(0.2),(0.08),(3.38),(6.31)
#Below are the standard errors corresponding to each variable in the specified order.
#3(c)

anova(model2)

## Analysis of Variance Table


##
## Response: return
## Df Sum Sq Mean Sq F value Pr(>F)
## dkr 1 3079 3078.86 1.9910 0.1605
## eps 1 608 607.92 0.3931 0.5317
## log(netinc) 1 1518 1517.84 0.9815 0.3236
## log(salary) 1 2035 2035.22 1.3161 0.2533
## Residuals 137 211856 1546.40

#In the second model, mirroring the findings of the first, none of the variables exhibit statistical significance
based on their F-values. This suggests that the relationships between these variables and the outcome
variable (return) are not strong enough to be considered meaningful. Specifically, the estimates for the debt
to capital ratio and salary are very close to zero, indicating little to no impact on the return. Moreover,
the negative coefficient for the logarithm of net income implies a potential inverse relationship with return,
though not statistically significant in this analysis.
#3.D)
#Given that none of the factors in either model demonstrate statistical significance, the predictability of
stock returns appears to be limited. The R-squared value indicates that less than 4% of the variation in
return can be attributed to changes in the independent variables included in the models. This suggests a
weak relationship between the predictors (market value, earnings per share, net income, salary, etc.) and
the outcome variable (return on investment). Consequently, the models may not adequately capture the
complex dynamics influencing stock returns, highlighting the need for further exploration or refinement of
variables to improve predictive accuracy.

You might also like