missing values in gstat for R
I would add (as a sincere question): wouldn't be the case of listwise deletion or multiple imputation? How does pairwise deletion behave for gstat? See http://www.uvm.edu/~dhowell/StatPages/More_Stuff/Missing_Data/Missing.html
On Tue, Dec 1, 2009 at 8:51 AM, Jon Olav Skoien <j.skoien at geo.uu.nl> wrote:
Hi Friederike, For which variable do you have NAs? If soil moisture is sm, you are missing in the first line: [!is.na(soildmD79.sp$smoist.20.06.2005),] If that is not the problem, it would be helpful if you sent a reproducible example. Cheers, Jon Friederike.Gerschlauer at agrar.uni-giessen.de wrote:
Dear list, I am having problems with dealing with missing values in gstat computing a semivariogram. I am using R 2.9.1, gstat 0.9-64 on Windows Vista. I get the following error message: g <- gstat(id = "sm", formula = smoist.20.06.2005 ~ 1, data = soildmD79.sp) g <- gstat(g, id = "bd", formula = BD ~ 1, data = soildmD79.sp[!is.na(soildmD79.sp$BD),]) g <- gstat(g, id = "S", formula = S ~ 1, data = soildmD79.sp[!is.na(soildmD79.sp$S),]) g <- gstat(g, id = "U", formula = U ~ 1, data = soildmD79.sp[!is.na(soildmD79.sp$U),]) g <- gstat(g, id = "T", formula = T ~ 1, data = soildmD79.sp[!is.na(soildmD79.sp$T),]) g <- gstat(g, id = "GMD", formula = GMD ~ 1, data = soildmD79.sp[!is.na(soildmD79.sp$GMD),]) g <- gstat(g, id = "vcover", formula = vcover ~ 1, data = soildmD79.sp[!is.na(soildmD79.sp$vcover),]) g <- gstat(g, id = "mean_C", formula = mean_C~ 1, data = soildmD79.sp[!is.na(soildmD79.sp$mean_C),]) g <- gstat(g, id = "biomass", formula = biomass ?~ 1, data = soildmD79.sp[!is.na(soildmD79.sp$biomass),]) png(file = "sm_soilparamter_cross_20-06-2005.png", width = 1400, height = 1000, bg = "white", res = 100) plot(variogram(g), main = "Cross variograms Soil moisture and stable soil parameters", sub="20/06/2005") Error: dimensions do not match: locations 200 and data 96 This message occurs due to 100 x,y coordinate pairs and 96 values for the variable soil moisture. Even though the function contains already "data = soildmD79.sp[!is.na(soildmD79.sp$BD),]" the missing values still cause an error. Thanks for any suggestions or comments, Friederike
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo