Ruben Roa Ureta
2006-Sep-11 04:59 UTC
[R] Extracting mean level of factor for all levels from a glm
ComRades: I have a glm where interest lies in the estimated mean levels of the response Y for every level of factor Year (regardeless of statistical significance of the factor), when the effect of other factors have been accounted for. The model is of the form: fit<-glm(Y~Year+Mo+Area+Ship+Eff,family=gaussian(link="log"),data=data) where Year is categorical and has T levels (labeled 1 to T in the data). Help much appreciated on how to extract these 'standardised' annual estimates of Y and their standard errors. Rub?n
Ruben Roa Ureta
2006-Sep-11 16:35 UTC
[R] Extracting mean level of factor for all levels from a glm
> ComRades: > > I have a glm where interest lies in the estimated mean levels of the > response Y for every level of factor Year (regardeless of statistical > significance of the factor), when the effect of other factors have been > accounted for. The model is of the form: > > fit<-glm(Y~Year+Mo+Area+Ship+Eff,family=gaussian(link="log"),data=data) > > where Year is categorical and has T levels (labeled 1 to T in the data). > Help much appreciated on how to extract these 'standardised' annual > estimates of Y and their standard errors. > > Rub?nAnswering my own question. The problem was that I should write fit<-glm(Y~as.factor(Year)+as.factor(Mo)+as.factor(Area)+as.factor(Ship) +Eff,family=gaussian(link="log"),data=data) then fit$coeff will give me want I wanted, a standardised measure of the effect of Year on Y when other measurable influences has been accounted for. Thanks anyway, Rub?n