[R] Fitted values problem

B Jessop anguillaphile at outlook.com
Mon Jul 20 02:11:07 CEST 2015


Dear list,
 
I have run two ancova models with the same data, one where the covariate Length was centered by Site (group mean centered), the other with Length not centered. The package "car" was used.  The models are:
ancova1a <- lm(log10(Weight) ~ LenCtd2 + Site, data = Data2); Length centered model, Length log10 transformed.
 
ancova2a <- lm(log10(Weight) ~ log10(Length) + Site, data = Data2); Length not centered model.
 
For each model, adjusted mean Weights for each Site were estimated with the "effects" package.  I then extracted the fitted values for each model using "fitted()" and saved them to a file.  For the model ancova1a, the mean of the fitted Weight values for each Site equalled the adjusted mean Weight for that Site.  For model ancova2a, the fitted values were exactly the same as for model ancova1a and the Site means thus did not match the comparable adjusted mean Weights, which differed between models.  This puzzles me, and has for some time as I searched for enlightenment, and I hope that someone can provide an answer to me. My original intent was to correlate the fitted values from each model with values of another variable.  
 
Some might recognize the above models as essentially estimating weight at length or condition in animals, in this case fish.  
 
Thanks for any assistance.
 
Regards,
B. Jessop
 		 	   		  
	[[alternative HTML version deleted]]



More information about the R-help mailing list