I want to use a mirco sampling data in R,but the package used in R is systemfit which doesn't support sampling weight(in stata,we can use option pweight),so I need to make some transformation to data in advance,. My question is how to transform constants in stata.
In stata,if we want to use mirco sampling data for OLS,we can use this code:
Code:
reg y x [pweight = weight] *If we don't have constant,this order will be: reg y x [pweight = weight],nocons *and we can do it by hand,the next three codes are equal to "reg y x [pweight = weight],nocons" replace y = y*((weight)^0.5) replace x = x*((weight)^0.5) reg y x,noncons
Many thanks
0 Response to How can I use pweight by hand?
Post a Comment