Summary method for the regress function

# S3 method for regress
summary(object, sum_check = "", conf_lev = 0.95, test_var = "", dec = 3, ...)

Arguments

object

Return value from regress

sum_check

Optional output. "rsme" to show the root mean squared error and the standard deviation of the residuals. "sumsquares" to show the sum of squares table. "vif" to show multicollinearity diagnostics. "confint" to show coefficient confidence interval estimates.

conf_lev

Confidence level used to estimate confidence intervals (.95 is the default)

test_var

Variables to evaluate in model comparison (i.e., a competing models F-test)

dec

Number of decimals to show

...

further arguments passed to or from other methods

Details

See https://radiant-rstats.github.io/docs/model/regress.html for an example in Radiant

See also

regress to generate the results

plot.regress to plot results

predict.regress to generate predictions

Examples

result <- regress(diamonds, "price", c("carat", "clarity")) summary(result, sum_check = c("rmse", "sumsquares", "vif", "confint"), test_var = "clarity")
#> Linear regression (OLS) #> Data : diamonds #> Response variable : price #> Explanatory variables: carat, clarity #> Null hyp.: the effect of x on price is zero #> Alt. hyp.: the effect of x on price is not zero #> #> coefficient std.error t.value p.value #> (Intercept) -6780.993 204.952 -33.086 < .001 *** #> carat 8438.030 51.101 165.125 < .001 *** #> clarity|SI2 2790.760 201.395 13.857 < .001 *** #> clarity|SI1 3608.531 200.508 17.997 < .001 *** #> clarity|VS2 4249.906 201.607 21.080 < .001 *** #> clarity|VS1 4461.956 204.592 21.809 < .001 *** #> clarity|VVS2 5109.476 210.207 24.307 < .001 *** #> clarity|VVS1 5027.669 214.251 23.466 < .001 *** #> clarity|IF 5265.170 233.658 22.534 < .001 *** #> #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> R-squared: 0.904, Adjusted R-squared: 0.904 #> F-statistic: 3530.024 df(8,2991), p.value < .001 #> Nr obs: 3,000 #> #> Prediction error (RMSE): 1224.329 #> Residual st.dev (RSD): 1226.17 #> #> Sum of squares: #> df SS #> Regression 8 42,458,933,806.968 #> Error 2,991 4,496,947,463.244 #> Total 2,999 46,955,881,270.212 #> #> Variance Inflation Factors #> carat clarity #> VIF 1.169 1.169 #> Rsq 0.145 0.145 #> #> coefficient 2.5% 97.5% +/- #> (Intercept) -6780.993 -7182.855 -6379.131 401.862 #> carat 8438.030 8337.834 8538.227 100.196 #> clarity|SI2 2790.760 2395.873 3185.646 394.886 #> clarity|SI1 3608.531 3215.384 4001.679 393.148 #> clarity|VS2 4249.906 3854.604 4645.208 395.302 #> clarity|VS1 4461.956 4060.801 4863.111 401.155 #> clarity|VVS2 5109.476 4697.311 5521.640 412.165 #> clarity|VVS1 5027.669 4607.574 5447.764 420.095 #> clarity|IF 5265.170 4807.024 5723.317 458.147 #> #> Model 1: price ~ carat #> Model 2: price ~ carat + clarity #> R-squared, Model 1 vs 2: 0.86 0.904 #> F-statistic: 197.585 df(7,2991), p.value < .001
result <- regress(ideal, "y", c("x1", "x2")) summary(result, test_var = "x2")
#> Linear regression (OLS) #> Data : ideal #> Response variable : y #> Explanatory variables: x1, x2 #> Null hyp.: the effect of x on y is zero #> Alt. hyp.: the effect of x on y is not zero #> #> coefficient std.error t.value p.value #> (Intercept) 3.108 0.221 14.079 < .001 *** #> x1 7.778 0.230 33.795 < .001 *** #> x2 -1.621 0.035 -46.870 < .001 *** #> #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> R-squared: 0.771, Adjusted R-squared: 0.771 #> F-statistic: 1681.071 df(2,997), p.value < .001 #> Nr obs: 1,000 #> #> Model 1: y ~ x1 #> Model 2: y ~ x1 + x2 #> R-squared, Model 1 vs 2: 0.267 0.771 #> F-statistic: 2196.762 df(1,997), p.value < .001
ideal %>% regress("y", "x1:x3") %>% summary()
#> Linear regression (OLS) #> Data : . #> Response variable : y #> Explanatory variables: x1, x2, x3 #> Null hyp.: the effect of x on y is zero #> Alt. hyp.: the effect of x on y is not zero #> #> coefficient std.error t.value p.value #> (Intercept) 0.669 0.279 2.398 0.017 * #> x1 7.713 0.213 36.157 < .001 *** #> x2 -1.987 0.043 -46.369 < .001 *** #> x3 0.902 0.070 12.861 < .001 *** #> #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> R-squared: 0.804, Adjusted R-squared: 0.803 #> F-statistic: 1360.646 df(3,996), p.value < .001 #> Nr obs: 1,000 #>