[R] Remove part of a summary of a model in a regression output

arun smartpink111 at yahoo.com
Tue Apr 1 20:37:11 CEST 2014


Hi,
You could extract the part you wanted by:

indx <- grepl("as.factor",names(mod1$coefficients))
 coef(summary(mod1))[!indx,] 

A.K.


On Tuesday, April 1, 2014 1:03 PM, Kumsa <waddeessa at gmail.com> wrote:
I would like to drop the out put part of the output that begins with
"as.factor(stratadow) in the summary of a model shown below.How can I
accomplish this task? Thanks

summary(mod1)

Family: poisson
Link function: log

Formula:
death ~ hw + temp + as.factor(stratadow)

Parametric coefficients:
                           Estimate Std. Error z value Pr(>|z|)
(Intercept)               1.4502766  0.3855373   3.762 0.000169 ***
hw                         0.0528747  0.1387688   0.381 0.703183
temp                     -0.0010948  0.0209806  -0.052 0.958382
as.factor(stratadow)1101  0.1240602  0.3351163   0.370 0.711233
as.factor(stratadow)1102  0.1226159  0.3352892   0.366 0.714588
as.factor(stratadow)1103  0.2711197  0.3246650   0.835 0.403675
as.factor(stratadow)1104  0.1746700  0.3309611   0.528 0.597662
as.factor(stratadow)1105  0.0677140  0.3407435   0.199 0.842478
as.factor(stratadow)1106 -0.0011192  0.3436671  -0.003 0.997402
as.factor(stratadow)1360  0.0117679  0.3441415   0.034 0.972722
as.factor(stratadow)1361 -0.0489304  0.3494791  -0.140 0.888652
as.factor(stratadow)1362  0.1235263  0.3349138   0.369 0.712254

    [[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.





More information about the R-help mailing list