Quantcast
Channel: Active questions tagged lm - Stack Overflow
Viewing all articles
Browse latest Browse all 124

How to return the last two lines of summary output from a linear model in R?

$
0
0

After finding a regression prediction in lm I want to return only last two lines of the summary. What would be the best function to use?

my_model_lm(y ~ x1 + x2 + x3, data = [data])summary_result <- summary(my_model)

I want to return only:Multiple R-squared: [value], Adjusted R-squared: [value]F-statistic: [value] on [value] and [value] DF, p-value: < [value]

I tried the tail() function, cat() function, summary(my_model$)r.squared at some basic level.Was not able to return the desirable output.


Viewing all articles
Browse latest Browse all 124


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>