![]() Lapply(summary(fit),”[[“,”r.squared”), and ended up with a list of 9 r-squared values which I converted to a numeric object before making a data frame of it. When I extracted the r-squared I used the lapply function, like this: When I apply summary(fit) I get 9 regression outputs, including all the summary statistics like residuals, coefficients (estimate, std error, t-value, p-value) as well as r-squared and adj r-squared. When I print the fit object I get the intercept (alpha) and the slope (beta) of each X-value, for each dependent variable, ie 9 columns with alpha, slope X1, slope X2 and slope X3. ![]() Let’s fit a linear regression model based on these data in R: ![]() The variable y is our target variable and the variables x1-圆 are the predictors. seed ( 1234421234 ) # Drawing randomly distributed data
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |