Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: how to generate the weights after sample and assign svyset

From   Anna Gueorguieva <>
Subject   st: how to generate the weights after sample and assign svyset
Date   Sun, 11 Mar 2007 10:22:16 -0700 (PDT)

Dear Statalist,
Would greatly appreciate your help with my two questions:
1. What weights correspond to my sample statement
2. How to svyset my 2 stage sample

1. I used the following code to generate my sample schools within each strata:

set seed  123456789
sample 4.28, by(lgacode numschools)

I was aiming to do a probability proportional to size (pps) sample but I do not think this is it (correct me if I am wrong). 

How does the by statement affect my sampling weights?

I think I just did simple random sampling and my code should be:
gen weight=1/sampling_probability=1/(.0428*numschools)

2. After the schools are sampled, teachers are sampled systematically:
One teacher within each class level as the teacher might be selected as the first, last or middle name in an alphabetized list. 

So my svyset statement for the school-level dataset should be: 
svyset school_code [pw=weight], strata(strata) fpc(numschools_bystrata)

and for the teacher-level dataset
gen teacher_weight=weight*(1/number_teachers_in_level)
svyset school_code [pw=teacher_weight], strata(strata) fpc(numschools_bystrata) || teacherid 

Thank you in advance.

Looking for earth-friendly autos? 
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.

*   For searches and help try:

© Copyright 1996–2020 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index