User Tools

Site Tools


multiple_regression_examples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
multiple_regression_examples [2017/05/31 09:58] – [Regression Diagnostics] hkimscilmultiple_regression_examples [2018/11/09 12:00] hkimscil
Line 110: Line 110:
 x3  work ethic x3  work ethic
 </code> </code>
 +from the above output:
 +| x  | zero-order cor  | part cor  | squared zero-order cor  | squared part cor  | shared square cor |
 +| x1 | .764  | .588  | 0.583696  | 0.345744  | 0.237952  |
 +| x2 | .769  | .594  | 0.591361  | 0.352836  | 0.238525  |
 +note that the values of two raws at the last column are similar. The portion is the shared effects from both x1 and x2.  
 +
 $$ \hat{Y_{i}} = 101.222 + 1.000X1_{i} + 1.071X2_{i} $$ $$ \hat{Y_{i}} = 101.222 + 1.000X1_{i} + 1.071X2_{i} $$
 $$ \hat{Y_{i}} = 101.222 + 1.000 \ \text{intell. ability}_{i} + 1.071 \ \text{work ethic}_{i} $$ $$ \hat{Y_{i}} = 101.222 + 1.000 \ \text{intell. ability}_{i} + 1.071 \ \text{work ethic}_{i} $$
Line 538: Line 544:
 {{:state.x77.reg.diagnostic.720.png}} {{:state.x77.reg.diagnostic.720.png}}
  
 +===== Model objects =====
  
 +<code>> names(model5)
 + [1] "coefficients"  "residuals"     "effects"       "rank"          "fitted.values"
 + [6] "assign"        "qr"            "df.residual"   "xlevels"       "call"         
 +[11] "terms"         "model"
 +</code>
 +<code>> coef(model5)                         # an extractor function
 +  (Intercept)    Population        Murder       HS.Grad         Frost 
 + 7.102713e+01  5.013998e-05 -3.001488e-01  4.658225e-02 -5.943290e-03 
 +> model5$coefficients                  # list indexing
 +  (Intercept)    Population        Murder       HS.Grad         Frost 
 + 7.102713e+01  5.013998e-05 -3.001488e-01  4.658225e-02 -5.943290e-03
 +> model5[[1]]                          # recall by position in the list (double brackets for lists)
 +  (Intercept)    Population        Murder       HS.Grad         Frost 
 + 7.102713e+01  5.013998e-05 -3.001488e-01  4.658225e-02 -5.943290e-03
 +</code>
 +
 +<code>> model5$resid
 +       Alabama         Alaska        Arizona       Arkansas     California 
 +    0.56888134    -0.54740399    -0.86415671     1.08626119    -0.08564599 
 +      Colorado    Connecticut       Delaware        Florida        Georgia 
 +    0.95645816     0.44541028    -1.06646884     0.04460505    -0.09694227 
 +        Hawaii          Idaho       Illinois        Indiana           Iowa 
 +    1.50683146     0.37010714    -0.05244160    -0.02158526     0.16347124 
 +        Kansas       Kentucky      Louisiana          Maine       Maryland 
 +    0.67648037     0.85582067    -0.39044846    -1.47095411    -0.29851996 
 + Massachusetts       Michigan      Minnesota    Mississippi       Missouri 
 +   -0.61105391     0.76106640     0.69440380    -0.91535384     0.58389969 
 +       Montana       Nebraska         Nevada  New Hampshire     New Jersey 
 +   -0.84024805     0.42967691    -0.49482393    -0.49635615    -0.66612086 
 +    New Mexico       New York North Carolina   North Dakota           Ohio 
 +    0.28880945    -0.07937149    -0.07624179     0.90350550    -0.26548767 
 +      Oklahoma         Oregon   Pennsylvania   Rhode Island South Carolina 
 +    0.26139958    -0.28445333    -0.95045527     0.13992982    -1.10109172 
 +  South Dakota      Tennessee          Texas           Utah        Vermont 
 +    0.06839119     0.64416651     0.92114057     0.84246817     0.57865019 
 +      Virginia     Washington  West Virginia      Wisconsin        Wyoming 
 +   -0.06691392    -0.96272426    -0.96982588     0.47004324    -0.58678863
 +</code>
 +
 +<code>
 +> sort(model5$resid)                   # extract residuals and sort them
 +         Maine South Carolina       Delaware  West Virginia     Washington 
 +   -1.47095411    -1.10109172    -1.06646884    -0.96982588    -0.96272426 
 +  Pennsylvania    Mississippi        Arizona        Montana     New Jersey 
 +   -0.95045527    -0.91535384    -0.86415671    -0.84024805    -0.66612086 
 + Massachusetts        Wyoming         Alaska  New Hampshire         Nevada 
 +   -0.61105391    -0.58678863    -0.54740399    -0.49635615    -0.49482393 
 +     Louisiana       Maryland         Oregon           Ohio        Georgia 
 +   -0.39044846    -0.29851996    -0.28445333    -0.26548767    -0.09694227 
 +    California       New York North Carolina       Virginia       Illinois 
 +   -0.08564599    -0.07937149    -0.07624179    -0.06691392    -0.05244160 
 +       Indiana        Florida   South Dakota   Rhode Island           Iowa 
 +   -0.02158526     0.04460505     0.06839119     0.13992982     0.16347124 
 +      Oklahoma     New Mexico          Idaho       Nebraska    Connecticut 
 +    0.26139958     0.28880945     0.37010714     0.42967691     0.44541028 
 +     Wisconsin        Alabama        Vermont       Missouri      Tennessee 
 +    0.47004324     0.56888134     0.57865019     0.58389969     0.64416651 
 +        Kansas      Minnesota       Michigan           Utah       Kentucky 
 +    0.67648037     0.69440380     0.76106640     0.84246817     0.85582067 
 +  North Dakota          Texas       Colorado       Arkansas         Hawaii 
 +    0.90350550     0.92114057     0.95645816     1.08626119     1.50683146
 +    
 +</code>
multiple_regression_examples.txt · Last modified: 2023/10/21 13:26 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki