Hi, everyone
I have a model like. cpue=catch*1000/Hook glmmodel=glm(log(cpue)~yy+qq+cc+pp, family=gaussian) and I want to estimate yy, qq, cc, pp effect and CI A senior scientist suggested to use model <- cbind(yhat=predict.glm(glmmodel, se.fit=T), DATA) yy_effect = with(model, tapply(fit, yy, mean)) yy_effect.se = with(model, tapply(se.fit, yy, mean)) STD_CPUE_yy = exp(yy_effect+yy_effect.se/2); It's confusing me, because I don't understand 1). why calculate mean first before exp, 2). why +se/2 and 3). How can I calculate CI for STD_CPUE_yy? My previous code was. yhat = predict.glm(glmmodel, se.fit=T,interval = "predict") pcpue =exp(yhat$fit) pcatch = pcpue*yftcpue$Hook/1000 model=cbind(yftcpue,pcatch,pcpue) #calculate mean predication for each yy yypcatch= with(model, tapply(pcatch, yy, sum)) yyhook= with(model, tapply(Hook, yy, sum)) yypcatch/yyhook*1000 # calculate CI for each yy upp= model$fit+1.96*model$se.fit low= model$fit-1.96*model$se.fit thanks for help [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.