Programming the statistical procedures from SAS

Replicate weights

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 11
Accepted Solution

Replicate weights

My dataset has 28 replicate weights and I use them in "PROC SURVEYFREQ" using the repweights statement. In the results viewer, I noticed in the Variance Estimation table that the number of replicates is listed as 12. Why is there a discrepancy in the number of replicate weights in the dataset and the results viewer? 


Accepted Solutions
Solution
‎03-16-2017 09:06 PM
Super User
Posts: 10,871

Re: Replicate weights

Try

 

REPWEIGHTS CI_FWT1 - CI_FWT28;

 

You didn't say but I suspect that the replicates used were CI_FWT1, CI_FWT10 through 19 and CI_FWT28

Reason:

CI_FWT1: says use all of the variables that start with CI_FWT1    ( first 11 variable as above)

and then ADDED the CI_FWT28.

 

Test this by using:

data junk;

    set CIrear15;

    keep CI_FWT1:CI_FWT28;

run;

and see if the variables I mentioned are the only ones in the set.

The - says to use the numbered range in the list 1 through 28.

 

View solution in original post


All Replies
Super User
Posts: 10,871

Re: Replicate weights

Please post the code used. Other options may have influence on the result.

 

Also from the documentation:

Each REPWEIGHTS variable should contain the weights for a single replicate, and the number of replicates equals the number of REPWEIGHTS variables. The REPWEIGHTS variables must be numeric, and the variable values must be nonnegative numbers.

 

So how many variables were on your REPWEIGHTS statement?

This could also be the case of analyzing one or more variables with low frequency that had missing values for all the records in some replicates.

 

 

 

Occasional Contributor
Posts: 11

Re: Replicate weights

Thanks. Here is the code.

 

proc surveyfreq data=CIrear15;
REPWEIGHTS CI_FWT1:CI_FWT28;
weight CI_FWT0;
TABLES SEAT_BELT;
run;

 

There are 28 replicate weights and they are all numeric and nonnegative numbers. I do not get any error or warning messages when I run this code. I am just curious why the results window shows 12 replicate weights even though there are 28 replicate weights in the dataset.

Solution
‎03-16-2017 09:06 PM
Super User
Posts: 10,871

Re: Replicate weights

Try

 

REPWEIGHTS CI_FWT1 - CI_FWT28;

 

You didn't say but I suspect that the replicates used were CI_FWT1, CI_FWT10 through 19 and CI_FWT28

Reason:

CI_FWT1: says use all of the variables that start with CI_FWT1    ( first 11 variable as above)

and then ADDED the CI_FWT28.

 

Test this by using:

data junk;

    set CIrear15;

    keep CI_FWT1:CI_FWT28;

run;

and see if the variables I mentioned are the only ones in the set.

The - says to use the numbered range in the list 1 through 28.

 

Occasional Contributor
Posts: 11

Re: Replicate weights

Thank you for the suggestion! That worked. I was using the wrong code.
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 3872 views
  • 0 likes
  • 2 in conversation