2
When I use the complex sample average command, a warning appears that there are Missing values in Weights, but I am using the option na.rm = TRUE
. Does anyone know what happens?
Follow the passage:
svymean(basedados$variavel , svydesign( id = basedados$estrato , weight =
basedados$peso ),na.rm=TRUE)
> Erro em na.weight(data.frame(weights)) : missing values in `weights'
I also tested this version and nothing:
svymean(dp$Dcoracao , svydesign( id = dp$V0024 , weight = dp$teste , na.rm = TRUE
),na.rm=TRUE)
> Erro em na.weight(data.frame(weights)) : missing values in `weights'
Hello Rafael Nishimura, I tried to use the command and another error message appeared: Mean(bd$Dcoracao , svydesign(id = bd[which(! is.na(bd$test)),"V0024"], Weight = bd[which(! is.na(bd$test)),"test"]) tapply error(1:NROW(x), list(factor(strata)), Function(index) { : Arguments must have same length Also: Missed warning messages: 1: In x * pweights : length of the larger object is not multiple of length of the smaller object 2: In x * pweights : length of the larger object is not multiple of the length of the smaller object >
– Henrique Pizarro