The dataset is not posted in the tabular format , hence i am going to generate some random dataset , but the r code would still remain the same with the only change being the datapoints
The r snippet is as follows
set.seed(1234)
x<- runif(n=48,min=-0.00001,max=0.01)
y<- runif(n=48,min=-0.00001,max=0.01)
df<- data.frame(cbind(x,y))
# fit the model
fit<- lm(y~x,data=df)
# see the summary stats
summary(fit)
# load the data for the next 10 months
xnext <- as.data.frame(runif(n=10,min=-0.00001,max=0.01))
# get the prediction interval
p<-predict(fit, xnext, interval="prediction")
p<- as.data.frame(p)
# y next
ynext <-
as.data.frame(runif(n=10,min=-0.00001,max=0.01))
p<- p[1:10,]
p<- cbind(p,ynext)
colnames(p)[4] <- c("ynext")
p$range <- p$upr-p$lwr
p.in.range <- ifelse(p$ynext<=p$upr &
p$ynext<=p$lwr,1,0 )
sum(p.in.range)
The resutls are
> summary(fit)
Call:
lm(formula = y ~ x)
Residuals:
Min 1Q Median 3Q Max
-0.004276 -0.002575 -0.000738 0.002701 0.005238
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.0038100 0.0008767 4.346 7.59e-05 ***
x 0.0708689 0.1636809 0.433 0.667
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.002964 on 46 degrees of freedom
Multiple R-squared: 0.004059, Adjusted R-squared:
-0.01759
F-statistic: 0.1875 on 1 and 46 DF, p-value: 0.6671
Based on the results the regrtession equation is Y = 0.0038 + 0.07*x , which are Beta0 and Beta1 for you
Please note that this is on simulated data , however you just need to change the datasources to see the relevant results
a simple snapshot of the dataframe would be as follows
The variables are x=SP500 market monthly log return and y = monthly return of Yahoo for...
5. Using the estimated regression equation for estimation and prediction Aa Aa Market model is a term used in finance to describe a linear regression model in which the dependent variable is the return on a stock and the independent variable is the return on the overall market. The market model is sometimes extended to include other independent variables-for example, the return on a specific industry sector. Company A is one of the leading software companies in the world. Suppose...
Name Economics 5 Ch 13 and 14 Practice Part 2 The following data are the monthly salaries y and the grade point averages x for students who obtained a bachelor's degree in business administration. answer key -Edited a Search Obser- GPA index xyi (x,-司 Salaryxi-Xyv-V) 0.36 3301.3 -348.7 121558.2 1.8 122500 100.043766.2116.2 13505.216627626.4 2500 0.16 3882.4 232.4 54022.8 117.6 13823.2122500 0.0 -150.0 22498.8 22500 0.09 3824.3174.3 30387.5 75.7 5727.5 62500 210 2.6 3300 0.6 350 1.3 3.4 3600 02 -50...
Need help with stats true or false questions
Decide (with short explanations) whether the following statements are true or false a) We consider the model y-Ao +A(z) +E. Let (-0.01, 1.5) be a 95% confidence interval for A In this case, a t-test with significance level 1% rejects the null hypothesis Ho : A-0 against a two sided alternative. b) Complicated models with a lot of parameters are better for prediction then simple models with just a few parameters c)...
The questions involve the data set for asking prices of Richmond
townhouses obtained on 2014.11.03.
For your subset, the response variable is:
asking price divided by 10000:
askpr=c(53.9, 50.8, 46.8, 48.8, 62.9, 68.8, 62.8888, 58.68, 54.8,
79.99, 55.8, 60.8, 73.8, 56.88, 25.9, 47.9, 65.8, 45.99, 59.8,
50.8, 57.8, 55.2, 54.8, 52.4, 56.8, 81.9, 40.8, 48.5, 51.68, 58.8,
40.8, 33.7, 68.5, 53.8, 41.99, 58.39, 68.5, 73.9, 79.8, 26.99,
68.8, 47.8, 78.8, 71.99, 57.5, 54.98, 77.8, 57.8, 53.8, 74.8)
The explanatory variables...
explaim the mechanisms amd toxological effects if type 1
diabetes in this article
Exposure to arsenic in drinking water is associated with increased prevalence of diabetes. We previously reported an association of diabetes and urinary concentration of dimethylarsinite (DMAS"), a toxic product of arsenic methylation by arsenic (+ 3 oxidation state) methyltransferase (AS3MT). Here we examine associations between AS3MT polymorphism, arsenic metabolism and diabetes. Fasting blood glucose, oral glucose tolerance and self-reported diagnoses were used to identify diabetic individuals. Inorganic...