[R] Summary model with observations taken out and dummied back in - not working

RRRRRRRRRRR ruthsurveys at gmail.com
Fri Dec 9 11:59:58 CET 2011


I have a data set with 35 observations and 4 variables. I have removed 4
observations as they were skewing the data analysis but I want to dummy them
back in, (not entirely sure on the reason, but have been told I should try). 

I have used this in order to do it, but I am not getting any statistical
analysis with my dummy it's all NA.

> dummy15=rep(0, times=n)
> dummy15[15]=1
> which(psubset1==0)
[1] 10 15 21 27
> dummytest = lm(price ~ pct.children + wealth +  pct.walk + pct.emp +
> dummy15, data = mydata, *subset = as.logical(subset)*) 
> summary(dummytest)

Call:
lm(formula = price ~ pct.children + wealth +  pct.walk + pct.emp + dummy15,
data = mydata, *subset = as.logical(subset)*)

Residuals:
   Min     1Q Median     3Q    Max 
-32708  -8861    383   8492  22609 

Coefficients: (1 not defined because of singularities)
                 Estimate Std. Error t value Pr(>|t|)    
(Intercept)     7.545e+04  1.073e+04   7.030 1.82e-07 ***
pct.children  3.541e+03  4.069e+02   8.703 3.52e-09 ***
wealth   1.450e-01  1.894e-02   7.654 4.01e-08 ***
pct.walk      -2.727e+03  6.007e+02  -4.539 0.000113 ***
pct.emp       4.785e+03  1.556e+03   3.075 0.004903 ** 
dummy15                NA         NA      NA       NA    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Residual standard error: 13950 on 26 degrees of freedom
Multiple R-squared: 0.9618,     Adjusted R-squared: 0.9559 
F-statistic: 163.6 on 4 and 26 DF,  p-value: < 2.2e-16 




If I take out the section highlighted in bold, my summary of the model
includes all the other observations I have previously taken out, 10, 21 and
27. 

I hope this makes sense? if not I'd be happy to try and clarify anything.
Thank you very much for any help

--
View this message in context: http://r.789695.n4.nabble.com/Summary-model-with-observations-taken-out-and-dummied-back-in-not-working-tp4176123p4176123.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list