본문 바로가기
R/R Commander Plug-in

RcmdrPlugin.MPAstats

by 거인과난쟁이 2017. 4. 1.


Description: Extends R Commander with a unified menu of new and pre-existing 
        statistical functions related to public management and policy analysis 
        statistics. Functions and menus have been renamed according to the 
        usage in PMGT 630 in the Master of Public Administration program at
        Brigham Young University.


> data(Prestige)

> LinearModel.1 <- lm(prestige ~ income + education, data=Prestige)

> model <- summary(LinearModel.1)

> model

Call:
lm(formula = prestige ~ income + education, data = Prestige)

Residuals:
     Min       1Q   Median       3Q      Max
-19.4040  -5.3308   0.0154   4.9803  17.6889

Coefficients:
              Estimate Std. Error t value Pr(>|t|)   
(Intercept) -6.8477787  3.2189771  -2.127   0.0359 * 
income       0.0013612  0.0002242   6.071 2.36e-08 ***
education    4.1374444  0.3489120  11.858  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 7.81 on 99 degrees of freedom
Multiple R-squared:  0.798,    Adjusted R-squared:  0.7939
F-statistic: 195.6 on 2 and 99 DF,  p-value: < 2.2e-16


> plot(Prestige$prestige,Prestige$income + education)

> abline(LinearModel.1)

> multipleRegressionWords(model) # MPAstats의 기능
Test Information: This test determines whether each independent variable predicts variation in
prestige, all other variables held constant.

The test assumes that prestige is normally distributed with equal variance across all values of any
independent variable. Each independent variable must have a linear relationship with prestige. 
****************************************************************

Test Results: Holding all other variables constant, income has a statistically significant positive
relationship with prestige. For a one unit increase in income, prestige increases by 0.001 units.
(t=6.071, p=0).

Test Information: This test determines whether each independent variable predicts variation in
prestige, all other variables held constant.

The test assumes that prestige is normally distributed with equal variance across all values of any
independent variable. Each independent variable must have a linear relationship with prestige. 
****************************************************************

Test Results: Holding all other variables constant, education has a statistically significant
positive relationship with prestige. For a one unit increase in education, prestige increases by
4.137 units. (t=11.858, p=0).

The R-squared value of 0.798 (adjusted R-squared = 0.794) indicates that this formula explains about 79.8 percent of the variation in prestige, based on results from the current data.

To predict individual values of prestige based on the regression line, enter the appropriate values
for each independent variable into the formula below.  Predictions may be under- or over-estimates of the actual value of prestige.

prestige = -6.848 + 0.001 * income + 4.137 * education