Question

In: Statistics and Probability

Solve it by R Use the “d_logret_6stocks” dataset to answer the questions. Test by using α=...

Solve it by R

Use the “d_logret_6stocks” dataset to answer the questions. Test by using α= .01. (General Motor: GenMotor).

(1) Regress the return of General Motor on the returns of Citigroup (with intercept). Report the estimated coefficients. Is there any evidence to show strong linear relationship between these two variables at significance level 5%?

(2) Suppose we “know” the return of Citigroup tomorrow is 0.05, what is the predicted return of General Motor tomorrow?

(3) Compute the correlation of General Motor and Citigroup, and test if their correlation is zero.

Here is “d_logret_6stocks” dataset. I bring this by this code.

rawdata <- read.table("d_logret_6stocks.txt",header=T)
rawdata

Date Pfizer Intel Citigroup AmerExp Exxon GenMotor
1 1-Aug-00 -0.001438612 0.049981263 0.044275101 0.017410003 0.0102248940 0.093294017
2 1-Sep-00 0.017489274 -0.255619266 -0.033536503 0.012656982 0.0379890200 -0.032209239
3 2-Oct-00 -0.017046116 0.034546736 -0.011645582 -0.004897625 0.0003305550 -0.019602167
4 1-Nov-00 0.012012934 -0.072550667 -0.022674793 -0.038275870 -0.0036500200 -0.094891600
5 1-Dec-00 0.016278701 -0.102497868 0.010708311 0.000000000 -0.0052520490 0.012461253
6 2-Jan-01 -0.008063083 0.090223122 0.039900620 -0.066129678 -0.0141692430 0.022971579

Solutions

Expert Solution

Solution-1:

use lm fucntion in R to fit a linea rmodel

coeffcient function to get the coefficients

summary to get the summary of the model

Rcode;

df1 =read.table(header = TRUE, text ="

sno Date Pfizer Intel Citigroup AmerExp Exxon GenMotor
1 1-Aug-00 -0.001438612 0.049981263 0.044275101 0.017410003 0.0102248940 0.093294017
2 1-Sep-00 0.017489274 -0.255619266 -0.033536503 0.012656982 0.0379890200 -0.032209239
3 2-Oct-00 -0.017046116 0.034546736 -0.011645582 -0.004897625 0.0003305550 -0.019602167
4 1-Nov-00 0.012012934 -0.072550667 -0.022674793 -0.038275870 -0.0036500200 -0.094891600
5 1-Dec-00 0.016278701 -0.102497868 0.010708311 0.000000000 -0.0052520490 0.012461253
6 2-Jan-01 -0.008063083 0.090223122 0.039900620 -0.066129678 -0.0141692430 0.022971579
"
)
df1
linmod <- lm(GenMotor~Citigroup,data=df1)
coefficients(linmod)
summary(linmod)

Output:

coefficients(linmod)
(Intercept) Citigroup
-0.0103812 1.6395016
> summary(linmod)

Call:
lm(formula = GenMotor ~ Citigroup, data = df1)

Residuals:
1 2 3 4 5 6
0.031086 0.033155 0.009872 -0.047335 0.005286 -0.032064

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.01038 0.01525 -0.681 0.5335
Citigroup 1.63950 0.50654 3.237 0.0318 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.03695 on 4 degrees of freedom
Multiple R-squared: 0.7237,   Adjusted R-squared: 0.6546
F-statistic: 10.48 on 1 and 4 DF, p-value: 0.0317

Regression equation is

Genmotor= -0.0103812 +1.6395016 *citigroup

Ho:There is no linear relationship beteween Genmotor and citigroup

Ha::There is a linear relationship beteween Genmotor and citigroup

F= 10.48

p=0.0317

p<0.05

Reject Ho

Accept Ha

Conclusion:
There is suffcient statisitical evidence at 5% level of significance to conclude that  there is strong linear relationship between these two variables

(2) Suppose we “know” the return of Citigroup tomorrow is 0.05, what is the predicted return of General Motor tomorrow?

WIth predict fucntion in R we can predict

attach(df1)
newdata=data.frame(Citigroup=0.05)
predict(linmod,newdata)

Output:

1
0.07159388

Predicted returm for General Motor is
0.07159388

Solution-c:

perform cor.test in R

cor.test(df1$GenMotor,df1$Citigroup)

Output:

data: df1$GenMotor and df1$Citigroup
t = 3.2367, df = 4, p-value = 0.03177
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.1264003 0.9833561
sample estimates:
cor
0.8506958

Correlation coefficent=0.8506958

Ho:correlation=0

Ha:correlation not =0

alpha=0.05

t = 3.2367

, p-value = 0.03177

p<0.05

Reject Ho

Accept Ha

There is suffcient statistcal evidence at 5% level of significance to conclude that there is relationship between  

Genmotors and citi group


Related Solutions

Solve it by R Use the ‘cement’ dataset in ‘MASS’ package to answer the question. (1)...
Solve it by R Use the ‘cement’ dataset in ‘MASS’ package to answer the question. (1) Conduct the multiple linear regression, regress y value on x1, x2, x3 and x4 (without intercept). Report the estimated coefficients. Which predictor variables have strong linear relationship with response variable y at significance level 0.05? (2) What is the adjusted R square of your regression? What is the interquartile range (IQR) of the residuals from your regression? (3) Conduct a best subset regression (with...
Use the “d_logret_6stocks” dataset to answer the questions. (General Motor: GenMotor)(using R) (1) Regress the return...
Use the “d_logret_6stocks” dataset to answer the questions. (General Motor: GenMotor)(using R) (1) Regress the return of General Motor on the returns of Citigroup with intercept and without intercept, respectively. Report the estimated coefficients. (2) Generate an ANOVA table to conclude if regression effects are significant. (3) Compute the correlation of General Motor and Citigroup, and test if their correlation is zero. (4) Test if the proportion of returns of Citigroup greater than Pfizer is 0.6. dataset below Date   Pfizer  ...
ANSWER USING R CODE Using the dataset 'LakeHuron' which is a built in R dataset describing...
ANSWER USING R CODE Using the dataset 'LakeHuron' which is a built in R dataset describing the level in feet of Lake Huron from 1872- 1972. To assign the values into an ordinary vector,x, we can do the following 'x <- as.vector(LakeHuron)'. From there, we can access the data easily. Assume the values in X are a random sample from a normal population with distribution X. Also assume the X has an unknown mean and unknown standard deviation. With this...
Solve using R. You will need library(resampledata) and the dataset FlightDelays. Conduct a hypothesis test to...
Solve using R. You will need library(resampledata) and the dataset FlightDelays. Conduct a hypothesis test to see whether there is a difference in the variances of flight delay length between the two airlines. 1) Set a hypothesis for this test using appropriate notation 2) Using R, find the value of the observed test statistic 3) Using R, compute the P-value of the observed test statistic using a permutation distribution with N=10^5-1 resamples. If possible use comments so that it is...
Using R to solve these questions: 1.Consider the following dataset: fuel <- c(0.95, 0.52, 0.82, 0.89,...
Using R to solve these questions: 1.Consider the following dataset: fuel <- c(0.95, 0.52, 0.82, 0.89, 0.81) The numbers correspond to the amount of fuel burnt by a new type of high-efficiency engine under a randomised test load. A value of 1 corresponds to the same fuel efficiency as the old engine, values greater than one correspond to more fuel burned (hence lower efficiency) and values less than one correspond to greater efficiency. (a) One-sided or two-sided test? Justify. (b)...
Using R to solve these questions: 1.Consider the following dataset: fuel <- c(0.95, 0.52, 0.82, 0.89,...
Using R to solve these questions: 1.Consider the following dataset: fuel <- c(0.95, 0.52, 0.82, 0.89, 0.81) The numbers correspond to the amount of fuel burnt by a new type of high-efficiency engine under a randomised test load. A value of 1 corresponds to the same fuel efficiency as the old engine, values greater than one correspond to more fuel burned (hence lower efficiency) and values less than one correspond to greater efficiency. (a) One-sided or two-sided test? Justify. (b)...
Use the Article to answer the questions please: Social Distancing to Test If Technology Can Solve...
Use the Article to answer the questions please: Social Distancing to Test If Technology Can Solve the Loneliness Epidemic By NICOLE VAN GRONINGEN Article link: https://www.statnews.com/2020/04/07/using-social-distancing-to-test-if-technology-can-solve-the-loneliness-epidemic/ 1) Who do you think is the intended audience (reader) of this article? That is, who is the author, Nicole Groningen, writing the article for? Explain your answer in 1-2 sentences. 2) What is the purpose of this article? What verb (argue, explain, suggest, or another verb) best describes what she is doing, and...
Work these in R. Using library(resampledata) and the dataset Spruce to conduct a test to see...
Work these in R. Using library(resampledata) and the dataset Spruce to conduct a test to see if the mean difference in how much the seedling grew (in height) over the course of the study under these two treatments are significantly different from each other. Answer the following: a) Set up a hypothesis using appropriate notation. b)Find the value of the observed test statistic using R. c)Compute the P-value of the observed test statistic using a permutation distribution with N= 10^5-1....
Fitting a linear model using R a. Read the Toluca.txt dataset into R (this dataset can...
Fitting a linear model using R a. Read the Toluca.txt dataset into R (this dataset can be found on Canvas). Now fit a simple linear regression model with X = lotSize and Y = workHrs. Summarize the output from the model: the least square estimators, their standard errors, and corresponding p-values. b. Draw the scatterplot of Y versus X and add the least squares line to the scatterplot. c. Obtain the fitted values ˆyi and residuals ei . Print the...
Answer the correlation questions using the data below. Use α = 0.05. x y 7.1 4.8...
Answer the correlation questions using the data below. Use α = 0.05. x y 7.1 4.8 5.9 3.1 4.9 6.1 3.9 4.5 5.1 5.9 6.6 5.1 4.9 5.9 a) Compute the correlation. r =   b) Compute the appropriate test statistic(s) for H1: ρ > 0. critical value =  ; test statistic =   Decision:  ---Select--- Reject H0 Fail to reject H0 c) Compute the corresponding effect size(s) and indicate magnitude(s). If not appropriate, input and/or select "na" below. effect size =  ;  ---Select--- na trivial...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT