Question: I need help with my R studio. I already did the code in R, but I want to copy-paste it to R markdown and follow
I need help with my R studio. I already did the code in R, but I want to copy-paste it to R markdown and follow the instructions to create an ANOVA table comparing the two multiple regression fits in inline-block R markdown. Below are the codes in screenshots for the summary all.fit and summary total_bedrooms.fit and the ANOVA
comparing the two fits.
The code R is below:
anova(all.fit,total_bedrooms.fit) Analysis of Variance Table
Model 1: median_house_value ~ median_income + housing_median_age + total_rooms + total_bedrooms + population + households + latitude + longitude Model 2: median_house_value ~ total_bedrooms Res.Df RSS Df Sum of Sq F Pr(>F) 1 20631 9.9735e+13 2 20638 2.7413e+14 -7 -1.7439e+14 5153.5 > summary (total_bedrooms. fit) Call: 1m (formula = median_house_value total_bedrooms, data = houses.dat) Residuals: Min 10 Median -214259 -87387 -27790 30 57324 Max 300586 coefficients: Estimate Std. Error t value pr(>t (Intercept) 1.994e+05 1. 301e+03 153.254 > summary(all. fit) Call: 1m (formula = median_house_value data = houses.dat) Residuals: Min 10 -563013 -43592 Median - 11327 30 30307 Max 803996 coefficients: Estimate Std. Error t value Pr(>t) (Intercept) -3.594e+06 6.254e+04 -57.468 summary (total_bedrooms. fit) Call: 1m (formula = median_house_value total_bedrooms, data = houses.dat) Residuals: Min 10 Median -214259 -87387 -27790 30 57324 Max 300586 coefficients: Estimate Std. Error t value pr(>t (Intercept) 1.994e+05 1. 301e+03 153.254 > summary(all. fit) Call: 1m (formula = median_house_value data = houses.dat) Residuals: Min 10 -563013 -43592 Median - 11327 30 30307 Max 803996 coefficients: Estimate Std. Error t value Pr(>t) (Intercept) -3.594e+06 6.254e+04 -57.468
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
