Amit Sir - Assignment
Amit Sir - Assignment
------------------------------------------------------------------------------------------------------------------
For instance, you have to find alpha’s and beta’s of 5- companies listed on BSE Index. How
will you obtain the data for estimating alpha’s and beta’s of these 5 companies.
Time period=60 days
------------------------------------------------------------------------------------------------------------------
SOLUTION-
For completing this I will be taking top 5 companies according to their market
capitalization in BSE Index.
• Reliance Industries
• TCS
• HDFC Bank
• Bharti Airtel, and
• ICICI Bank.
Assumption-
1. Ri-Rf is assumed as y, and
2. Rm-Rf is assumed as x.
Reliance Industries-
1. R Studio History-
library(readxl)
Mydata <- read_excel("~/Downloads/Amit Sir_Assignment (1).xlsx",
sheet = "RELIANCE", range = "I1:J65")
View(Mydata)
library(readxl)
Mydata <- read_excel("~/Downloads/Amit Sir_Assignment (1).xlsx",
sheet = "RELIANCE", range = "I5:J66")
View(Mydata)
Model=lm(y~x,data=Mydata)
summary(Model)
options(scipen = 999)
summary(Model)
2. Summary generated-
Call:
lm(formula = y ~ x, data = Mydata)
Residuals:
Min 1Q Median 3Q Max
-0.033748 -0.005280 0.000462 0.007010 0.032530
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.001101 0.001347 0.818 0.417
x 1.024275 0.097030 10.556 0.00000000000000325 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
3. Interpretation-
This output represents the results of a linear regression model (‘lm’) in R, where ‘y’
is being modeled as a function of ‘x’. Here's a breakdown of the data and
interpretation:
1. Residuals:
- The residuals show the difference between the observed and predicted values of
‘y’. The minimum, first quartile (1Q), median, third quartile (3Q), and maximum
values of the residuals are presented. This provides an indication of how well the
model fits the data, with a median close to 0 indicating a good fit.
2. Coefficients:
- (Intercept):
- Estimate: 0.001101
- This is the intercept ‘alpha’, often referred to as the constant term. It represents
the value of ‘y’ when ‘x’ is zero.
- The associated t-value is 0.818, and the p-value is 0.417, which is not
statistically significant (p > 0.05). This suggests that the intercept is not significantly
different from 0.
- x:
- Estimate: 1.024275
- This is the slope ‘beta’ of the linear model, which represents the rate of change
in ‘y’ for a one-unit increase in ‘x’.
- The t-value is 10.556, and the p-value is extremely small (close to 0), which
indicates that the slope is highly significant. This suggests that there is a strong
linear relationship between ‘x’ and ‘y’.
3. Model Significance:
- Residual standard error: 0.01049
- This represents the average distance that the observed values fall from the
regression line. A smaller value indicates better model accuracy.
- F-statistic: 111.4
- This indicates the overall significance of the model. The associated p-value is
very small, meaning that the model as a whole is statistically significant.
Conclusion:
The regression model suggests that ‘x’ has a significant and positive effect on ‘y’,
with a slope ‘beta’ of approximately 1.02. The intercept ‘alpha’ is close to 0 and not
significant. The model explains about 65% of the variability in ‘y’, indicating a decent
fit.
-------------------------------------------------------------------------------------------------
TCS-
1. R Studio History-
library(readxl)
Mydata <- read_excel("~/Downloads/Amit Sir_Assignment (1).xlsx",
sheet = "TCS", range = "I5:J66")
View(Mydata)
Model=lm(y~x,data=Mydata)
options(scipen = 999)
summary(Model)
2. Summary Generated-
Call:
lm(formula = y ~ x, data = Mydata)
Residuals:
Min 1Q Median 3Q Max
-0.060422 -0.003834 0.001397 0.008600 0.025076
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.002337 0.001696 -1.378 0.173
x 0.612329 0.122209 5.010 0.00000524 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
3. Interpretation-
This output represents the results of a linear regression model where ‘y’ is being
modeled as a function of ‘x’. Below is the interpretation of the data and the
identification of the ‘beta’ and ‘alpha’ values:
1. Residuals:
- The residuals show the differences between the observed and predicted values
of ‘y’.
- The distribution of residuals suggests that the model's predictions vary slightly,
with a median value of approximately 0, indicating a reasonably good fit, though
some values deviate more than others.
2. Coefficients:
- (Intercept):
- Estimate: -0.002337
- This is the intercept ‘alpha’ of the regression equation, representing the
expected value of ‘y’ when ‘x = 0’.
- The t-value is -1.378, and the p-value is 0.173. Since the p-value is greater than
0.05, the intercept is not statistically significant, implying that the intercept is not
meaningfully different from 0.
- x:
- Estimate: 0.612329
- This is the slope ‘beta’ of the regression line, representing the estimated change
in ‘y’ for a one-unit increase in ‘x’.
- The t-value is 5.010, and the p-value is very small (0.00000524), indicating that
the slope is highly significant. Therefore, ‘x’ has a significant impact on ‘y’.
3. Model Significance:
- Residual standard error: 0.01321
- This measures the average distance between the observed and predicted
values. Smaller residual standard errors suggest a better model fit.
- F-statistic: 25.11
- The F-statistic tests the overall significance of the model. With a p-value of
0.000005244, the model is statistically significant, meaning that ‘x’ has a significant
overall effect on ‘y’.
Conclusion:
The regression model suggests that ‘x’ has a significant and positive effect on ‘y’,
with a slope ‘beta’ of approximately 0.612. The intercept ‘alpha’ is not significant,
and the model explains around 29.85% of the variability in ‘y’. While the model is
statistically significant overall, its explanatory power is moderate, indicating that
other factors might also influence ‘y’ beyond ‘x’.
-------------------------------------------------------------------------------------------------
HDFC Bank-
1. R Studio history-
library(readxl)
Mydata1 <- read_excel("~/Downloads/Amit Sir_Assignment (1).xlsx",
sheet = "HDFC BANK", range = "I5:J66")
View(Mydata1)
Model=lm(y~x,data=Mydata)
options(scipen = 999)
summary(Model)
Model=lm(y~x,data=Mydata1)
options(scipen = 999)
summary(Model1)
summary(Model)
2. Summary Generated-
Call:
lm(formula = y ~ x, data = Mydata1)
Residuals:
Min 1Q Median 3Q Max
-0.029849 -0.005109 0.000989 0.005201 0.044792
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.0002573 0.0015231 0.169 0.866
x 0.9274638 0.1097570 8.450 0.00000000000952 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
3. Interpretation-
This output represents the results of a linear regression model where ‘y’ is being
modeled as a function of ‘x’. Here's the interpretation of the data:
1. Residuals:
- The residuals provide the distribution of the differences between the
observed and predicted values of ‘y’.
- The minimum, first quartile (1Q), median, third quartile (3Q), and maximum
values of the residuals suggest that the residuals are fairly centered around 0,
with a relatively small spread, indicating a reasonably good fit for the model.
2. Coefficients:
- (Intercept):
- Estimate: 0.0002573
- This is the intercept ‘alpha’, which represents the expected value of ‘y’ when
‘x = 0’.
- The t-value is 0.169, and the p-value is 0.866. This suggests that the
intercept is not statistically significant (p > 0.05), meaning it doesn't provide
meaningful information about the model.
- x:
- Estimate: 0.9274638
- This is the slope ‘beta’, representing the expected change in ‘y’ for a one-unit
increase in ‘x’.
- The t-value is 8.450, and the p-value is extremely small (0.00000000000952),
which indicates that the slope is highly significant. This suggests that ‘x’ has a
strong and statistically significant influence on ‘y’.
3. Model Significance:
- Residual standard error: 0.01186
- This represents the average distance that the observed values fall from the
regression line. A smaller residual standard error indicates better model
accuracy.
- F-statistic: 71.41
- The F-statistic tests the overall significance of the model. With a very small
p-value (0.000000000009521), the model as a whole is statistically significant,
indicating that ‘x’ has a significant overall effect on ‘y’.
Conclusion:
The regression model shows that ‘x’ has a significant and positive effect on ‘y’,
with a slope ‘beta’ of approximately 0.927. The intercept ‘alpha’ is not
significant. The model explains around 54.76% of the variability in ‘y’, which
indicates a moderate fit. The overall model is statistically significant, confirming
that ‘x’ is an important predictor of ‘y’.
-----------------------------------------------------------------------------------------------------------------
BHARTI AIRTEL-
1. R Studio history-
library(readxl)
Mydata2 <- read_excel("~/Downloads/Amit Sir_Assignment (1).xlsx",
sheet = "BHARTI AIRTEL", range = "I5:J66")
View(Mydata2)
Model=lm(y~x,data=Mydata2)
options(scipen = 999)
summary(Model2)
summary(Model)
2. Summary Generated-
Call:
lm(formula = y ~ x, data = Mydata2)
Residuals:
Min 1Q Median 3Q Max
-0.0268319 -0.0062195 -0.0006345 0.0063890 0.0256708
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.0008209 0.0015059 -0.545 0.588
x 1.0664259 0.1085188 9.827 0.0000000000000492 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
3. Interpretation-
This output presents the results of a linear regression where ‘y’ is being modeled
as a function of ‘x’. Here's the detailed interpretation:
1. Residuals:
- The residuals represent the difference between the observed and predicted
values of ‘y’.
- The residual distribution is reasonably symmetric, with a median close to 0
and small deviations on both ends, suggesting a good fit of the model.
2. Coefficients:
- (Intercept):
- Estimate: -0.0008209
- This is the intercept ‘alpha’ of the regression equation, representing the
expected value of ‘y’ when x = 0.
- The t-value is -0.545, and the p-value is 0.588, which is much larger than
0.05. This means that the intercept is not statistically significant, suggesting it
does not add valuable information to the model.
- x:
- Estimate: 1.0664259
- This is the slope ‘beta’, representing the estimated change in ‘y’ for a one-
unit increase in ‘x’.
- The t-value is 9.827, and the p-value is extremely small
(0.0000000000000492), which means the slope is highly significant. Therefore,
‘x’ has a strong and statistically significant influence on ‘y’.
3. Model Significance:
- Residual standard error: 0.01173
- This value represents the average distance between the observed values and
the regression line. A smaller residual standard error indicates better model
accuracy.
- F-statistic: 96.57
- The F-statistic tests the overall significance of the model. With a very small
p-value (0.00000000000004922), the model is statistically significant, indicating
that ‘x’ has a significant overall effect on ‘y’.
Conclusion:
The regression model demonstrates that ‘x’ has a strong and statistically
significant effect on ‘y’, with a slope ‘beta’ of approximately 1.066. The intercept
‘alpha’ is not significant, meaning that it doesn’t have much impact on the
model. The model explains about 62.08% of the variability in ‘y’, indicating a
strong fit. Overall, the model is statistically significant, confirming the
importance of ‘x’ in predicting ‘y’.
-------------------------------------------------------------------------------------------------
ICICI BANK-
1. R Studio History-
library(readxl)
Mydata4 <- read_excel("~/Downloads/Amit Sir_Assignment (1).xlsx",
sheet = "ICICI BANK", range = "I5:J66")
View(Mydata4)
Model=lm(y~x,data=Mydata4)
options(scipen = 999)
summary(Model)
2. Summary Generated-
Call:
lm(formula = y ~ x, data = Mydata4)
Residuals:
Min 1Q Median 3Q Max
-0.0265534 -0.0058811 0.0003064 0.0057975 0.0168744
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.000433 0.001128 0.384 0.702
x 1.095943 0.081254 13.488 <0.0000000000000002 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
3. Interpretation-
This output represents the results of a linear regression where ‘y’ is modeled as
a function of ‘x’. Here's the breakdown and interpretation:
1. Residuals:
- The residuals show the distribution of the differences between the observed
and predicted values of ‘y’.
- The residuals are fairly symmetric and centered close to zero, suggesting that
the model provides a good fit to the data.
2. Coefficients:
- (Intercept):
- Estimate: 0.000433
- This is the intercept ‘alpha’, representing the expected value of ‘y’ when ‘x =
0’.
- The t-value is 0.384, and the p-value is 0.702. Since the p-value is much
greater than 0.05, the intercept is not statistically significant, meaning it does
not contribute meaningfully to the model.
- x:
- Estimate: 1.095943
- This is the slope ‘beta’, which represents the estimated change in ‘y’ for a
one-unit increase in ‘x’.
- The t-value is 13.488, and the p-value is extremely small (less than
0.0000000000000002), indicating that the slope is highly significant. Thus, ‘x’
has a strong and statistically significant influence on ‘y’.
3. Model Significance:
- Residual standard error: 0.008781
- This indicates the average distance between the observed and predicted
values of ‘y’. A smaller residual standard error means the model has good
accuracy.
- F-statistic: 181.9
- The F-statistic tests the overall significance of the model. With a very small
p-value (less than 0.00000000000000022), the model is highly statistically
significant, indicating that ‘x’ has a substantial overall effect on ‘y’.
Conclusion:
The regression model demonstrates that ‘x’ has a strong and statistically
significant effect on ‘y’, with a slope ‘beta’ of approximately 1.096. The intercept
‘alpha’ is not significant, meaning it doesn't contribute to the model's predictive
power. The model explains about 75.51% of the variability in ‘y’, indicating a very
strong fit, and the overall model is highly significant, confirming that ‘x’ is a key
predictor of ‘y’.
-----------------------------------------------------------------------------------------------------------------
SENSEX & UTI GOLD ETF
SENSEX-
The table presents data related to the SENSEX, which is a major stock market index in India
that reflects the performance of the top 30 companies listed on the Bombay Stock
Exchange (BSE). The columns indicate the Date, the Open, High, Low, and Close values for
each day. The Rm column reflects the daily market return, which measures the percentage
change in the market index for that day.
Columns Explained:
Key Observations:
- Positive Returns: Days when the Rm column shows a positive value, such as 12-August-
2024 (0.008699), indicate that the market gained value compared to the previous day.
- Negative Returns: Days when the Rm column shows a negative value, such as 8-August-
2024 (-0.010391), indicate that the market lost value compared to the previous day.
Rm Column Significance:
The Rm column captures the daily percentage return for the SENSEX. This is crucial for
investors and analysts as it helps measure market performance on a day-to-day basis,
indicating how the overall market is performing and the volatility of the index. Positive
values in the Rm column reflect a bullish day in the market, while negative values indicate
a bearish day.
By observing the trends in the Rm column, one can gauge the market's general direction,
and it can be used in models like the Capital Asset Pricing Model (CAPM) to estimate
expected returns based on market movements.
-----------------------------------------------------------------------------------------------------------------
The data provided is for the UTI Gold ETF, which tracks the performance of gold prices.
Here’s a breakdown of the data and an explanation of the key columns:
Columns Breakdown:
1. Rf (Risk-Free Rate):
- The values under Rf represent the daily risk-free return. This is often used in financial
models like the Capital Asset Pricing Model (CAPM) to assess the return an investor would
expect to receive for taking on additional risk.
- Positive values of Rf indicate a positive risk-free return (e.g., government bonds), while
negative values, though unusual, might reflect a negative interest rate environment or
adjustments based on specific market conditions.
Example Interpretation:
- 29-August-2024:
- Rf: -0.003925 indicates that on this day, the risk-free return was negative.
- Rm - Rf: 0.007724 means the market return exceeded the risk-free return by 0.77%.
Investors were rewarded for taking market risk.
- 22-August-2024:
- Rf: 0.004601 shows that the risk-free rate was 0.46%.
- Rm - Rf: -0.005009 indicates that the market return was lower than the risk-free return by
0.50%, implying that the market underperformed relative to a risk-free investment.
Conclusion:
- Rf helps in understanding the baseline return investors could expect with no risk.
- Rm - Rf helps in assessing how much extra return (if any) the market is providing over the
risk-free return, thus allowing investors to gauge whether they are being adequately
compensated for the additional risk of investing in the market.
-----------------------------------------------------------------------------------------------------------------