[R] question regarding an error message from survey package
James Reilly
reilly at stat.auckland.ac.nz
Sun Nov 25 04:07:32 CET 2007
Your calibration model has one linear predictor, so it only has two
parameters, but you have specified three population totals. A slightly
different setup should work; try again with:
st <- factor(1:3, levels=c(3, 1:2))
pop<-c('(Intercept)'=100, st1=10, st2=20)
James Reilly
Department of Statistics, University of Auckland
Private Bag 92019, Auckland, New Zealand
On 25/11/07 6:47 AM, eugen pircalabelu wrote:
> Hi R-users!
> Can anyone tell me what this error message refers to exactly
>
>> a<-c('m','f','m')
>> b<-c(1:3)
>> st<-c(1:3)
>> data.frame(a,b,st)
> a b st
> 1 m 1 1
> 2 f 2 2
> 3 m 3 3
>> data.frame(a,b,st)->l
>> p<-svydesign(ids=~1, data=l)
>> pop<-c('(intercept)'=100, st1=10,st2=20)
>> calibrate(p,~st, pop)
> Error in regcalibrate.survey.design2(design, formula, population, aggregate.stage = aggregate.stage, :
> Population and sample totals are not the same length.
>
> Thank you and have a great day!
>
>
> ---------------------------------
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
More information about the R-help
mailing list