1

I'm trying to weight survey data in R. I'm using Stata code as a reference.

The code used on that program to weight my data was:

svyset [iw=wgtp], vce(sdr), sdrweight(wgtp1-wgtp80) mse

I translated that code into R code like this:

svydesign(ids = ~1, data = house.data, weights = (~wgtp1-wgtp80))

However I am unsure whether this is a correct translation and if I am applying this correctly in R. Any insight and suggestions would be greatly appreciated!

4

1 に答える 1

0

現在のバージョンの「survey」では、

svrepdesign(data=house.data, weights=~wgtp, repweights="wgtp[1-9]+",type="successive-difference")

これはsvrepdesign、反復重み、サンプリング重みwgtp、反復重みwgtp1-wgtp80、および「連続差分」重みを使用した調査用です。

于 2020-05-16T07:29:29.930 に答える