Dear List,
Some independent variable were missing in calculation using lm and glm (gaussian). (X= Y1+Y2+ ..+Y16, Independent number: 16 variable) However, those variables did work well in cor(X, Y) respectively. str(dataframe) was also run to ensure that the variables were all numbers. Moreover, the missing variables were different in lm and glm. In lm, 3 factors were not taken into consideration. In glm, only one of them was omitted. (attached 2 shots) Please kindly advise whether further info is in need to solve the issue. Also, if similar problems have been encountered, please kindly share your experience. Thank you. Elaine Code rm(list=ls()) library(MuMIn) datam <-read.csv("c:/migration/Mig_ratio_20100817.csv",header=T, row.names=1) dim(datam) datam[1,] # original regression model (16 indep. variables) Mig.lm <-lm(datam$SummerM_ratio~datam$temp_ran+datam$temp_mean+datam$temp_max+datam$temp_min+datam$evi_ran+datam$evi_mean+datam$evi_max+datam$evi_min+datam$prec_ran+datam$prec_mean+datam$prec_max+datam$prec_min+datam$topo_var+datam$topo_mean+datam$coast+datam$Iso_index_0808,data=datam) summary(mig.lm) mig.glm <-glm(datam$SummerM_ratio~datam$temp_ran+datam$temp_mean+datam$temp_max+datam$temp_min+datam$evi_ran+datam$evi_mean+datam$evi_max+datam$evi_min+datam$prec_ran+datam$prec_mean+datam$prec_max+datam$prec_min+datam$topo_var+datam$topo_mean+datam$coast+datam$Iso_index_0808,data=datam,family=gaussian) summary(mig.glm) [[alternative HTML version deleted]]
______________________________________________ R-help@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.