Hi Statalist experts,
Suppose I have data on a population of N subjects, each has X1-X5 and and variable p specifying its sampling probability. Each subject has an unequal probability of being selected. Supposed I would like to select a sample of size n taking into account the sampling probability, how would I do that? I am looking for a function that parallels the "sample(x, size, replace = , prob = )" function in R.
Thank you in advance!
Best,
Eva
Related Posts with How to sample with unequal probability in a given population
range function generating over 400 missing valuesHello, I am trying to make a Stata variable that stores 20 numbers between 0 and 1. I am using the …
Is it possible to use the Stata-python integration module inside of foreach Stata loop?Hello, I am trying to execute the code below and it is giving me an error, mainly because the Stata…
Using variable measured at different levels in a regressionDear statalist, I am studying the effect of banking competition at the local level on the relations…
Wrong coefficient in a fixed effects panel regressionHello, I'm trying to regress the impact that fiscal rules might have on the Primary Balance of a Co…
stata command unrecognized r(199) errorHello, I am trying to run the Stata code below, and everything runs except at the very end I am gett…
Subscribe to:
Post Comments (Atom)
0 Response to How to sample with unequal probability in a given population
Post a Comment