Question

In: Computer Science

Please  provide your summary on Linear Regression preferably with some code sample in R.

Please  provide your summary on Linear Regression preferably with some code sample in R.

Solutions

Expert Solution

Hi,

Suppose there are two variables X and Y a linear regression is used to represent how these variables are related or simply linear regression explains the relationship between the two variables.In a linear regression ,in the two variables one is dependent variable and the other is independent variable.Let us consider the eqution of linear regression goven below:

Y=a+bX

Here the variable Y is dependent variable and the variable X is independent variable.Y is called as dependent variable because it depend on the variable X.Whenever X changes the Y also changes.Here Y is also called as the response variable and X is also called as the predictor variable.a and b are constants.Here Y is a mathematical function of X and Y is obtained only if the value of X is known.

In R lm() function is used for linear regression.lm() means linear model.The syntax used to find lm() is :

lm[response variable] = lm([response variable]~[predictor variable],data=[data source]) and we use the command below to review the results:

summary(lm[response variable]) .

Let us consider an example we can find the weight of person if the height is known.There is a relationship between the height and weight of every person.So using linear regression in R we can do it as follows:

lmweight = lm(weight~height,data = height and weight) # here the linear regression is created

summary(lmweight) # the result is reviewed.

In this way linear regression is performed in R.

Thank you....


Related Solutions

The following is a regression summary from R for a linear regression model between an explanatory...
The following is a regression summary from R for a linear regression model between an explanatory variable x and a response variable y. The data contain n = 50 points. Assume that all the conditions for SLR are satisfied. Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.1016 0.4082 -2.699 -------** x 2.2606 0.0981 ---- < 2e-16 *** (a) Write the equation for the least squares regression line. (b) R performs a t-test to test whether the slope is significantly...
pl use R code to do that and show me the program Use a linear regression...
pl use R code to do that and show me the program Use a linear regression of Y~log(X) using the labtestdata.csv data to predict Y (2dp) when x = 250 on the unlogged scale? Calculate the F-value (1 dp) from an ANOVA on the regression of Y~log(X) using the data contained in labtestdata.csv abtestdata.csv y x 1.018746 1 1.508895 2 0.727282 3 1.787127 4 2.903983 5 3.181554 6 1.737834 7 2.715766 8 1.570552 9 3.046107 10 4.499675 11 4.240688 12...
Estimate a simple linear regression model and present the estimated linear equation. Display the regression summary...
Estimate a simple linear regression model and present the estimated linear equation. Display the regression summary table and interpret the intercept and slope coefficient estimates of the linear model.                                                           Estimate a simple linear regression model and present the estimated linear equation. Display the regression summary table and interpret the intercept and slope coefficient estimates of the linear model.                                                           
Estimate a simple linear regression model and present the estimated linear equation. Display the regression summary...
Estimate a simple linear regression model and present the estimated linear equation. Display the regression summary table and interpret the intercept and slope coefficient estimates of the linear model.                                                           
The following is the estimation results for a multiple linear regression model: SUMMARY OUTPUT             Regression...
The following is the estimation results for a multiple linear regression model: SUMMARY OUTPUT             Regression Statistics R-Square                                                       0.558 Regression Standard Error (S)                  863.100 Observations                                               35                                Coeff        StdError          t-Stat    Intercept               1283.000    352.000           3.65    X1                             25.228        8.631                       X2                               0.861        0.372           Questions: Interpret each coefficient.
The following is the estimation results for a multiple linear regression model: SUMMARY OUTPUT             Regression...
The following is the estimation results for a multiple linear regression model: SUMMARY OUTPUT             Regression Statistics R-Square                                                       0.558 Regression Standard Error (S)                  863.100 Observations                                               35                                Coeff        StdError          t-Stat    Intercept               1283.000    352.000           3.65    X1                             25.228        8.631                       X2                               0.861        0.372           Question: 1. A. Write the fitted regression equation. B. Write the estimated intercepts and slopes, associated with their corresponding standard errors. C. Interpret each coefficient.
Regression Analysis/Need R code/Step By Step Explanation/No Hand Written Regression: A) Provide a 95% Confidence interval...
Regression Analysis/Need R code/Step By Step Explanation/No Hand Written Regression: A) Provide a 95% Confidence interval for each of the estimated parameters B ) Use Hypothesis Testing to test the significance of Regression and Residual Analysis C) Perform Lack of fit test Apply corresponding transformation to correct model inadequacies if any. D) Perform Multicollinearity and Validate your model Accordingly. We seek a model of the form # # B = A0 * X0 + A1 * X1 + A2 *...
So, as we look at Linear Regression and correlation this week, please find provide an example...
So, as we look at Linear Regression and correlation this week, please find provide an example of how and when linear regression is used.
(Y and x) linear regression example with a made up numbers. Please provide a chart and...
(Y and x) linear regression example with a made up numbers. Please provide a chart and made up Question and numbers. I provided my question below. . Please help with the rest. Say you’re planning to save $60,000 dollars to buy a new pool. based off the salary 0f $6,000 month and your Bills on estimate of $3,250 mouth how many years will it take to save enough to buy the pool. First item on your checklist? Budget! It’s a...
***This problem must be done using R so please provide the R code used to find...
***This problem must be done using R so please provide the R code used to find the solution. I have provided the data in data-wtLoss.txt below the question. I will also give "thumbs-up for correct R code" Thanks in advance.*** The file “data-wtLoss.txt” contains data on weight loss and self esteem evaluation at three time points over a period of three months for 34 individuals who are randomly selected from a residential area. These individuals are randomly assigned to one...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT