Test of mean difference hypotheses in the R survey package

2

Please, using the Survey package, how do you test the mean difference hypotheses? i.e. if the sample mean of 2003 is the same in 2008 for a certain variable. I'm working with PNAD data

    
asked by anonymous 30.10.2014 / 16:32

1 answer

2

The function you will have to use is called svyttest .

In the examples, when you use help(svytest) it does as follows:

data(api)
dclus2<-svydesign(id=~dnum+snum, fpc=~fpc1+fpc2, data=apiclus2)
svyttest(enroll~comp.imp, dclus2)

In this example he compares the average number of students enrolled in American schools who have or have not met a "measure of comparable improvement."

In your case you should have an object created by the svydesign function right? So to test just use the svyttest function as follows:

svyttest(variavel_que_vc_quer_comparar~ano_como_fator, objeto_svydesign)

In any case, it would be interesting if you provided a small sample of your data to anyone trying to respond, to see if it is working for your problem.

    
30.10.2014 / 16:59