Hello,
We are trying to run a placebo test for our model and to do that we wish to randomly shuffle our Y variable, keeping the remaining dataset unchanged (such that the association between Y and the X's becomes random). We found the "shufflevar" command particularly useful to do this.
However, we wish to repeat this analysis 100 times and we observe that in every iteration "shufflevar" is shuffling the variable in the exact same way. As a result, each of the 100 iterations is just becoming an exact replica of each other. We would rather want a random shuffling each and every time, which gives us random Y's which are distinct from each other. Is there any other way in which we can just randomly mix up the values of the Y variable?
We would be extremely grateful if anyone could guide us on this! Thanks.
Related Posts with Randomly shuffling only one variable in Stata
Creating a Dummy variable (Time variant )Dear All, 1. I want to create a Dummy Variable ( Health Status of Indivuduals) which is either yes …
Reshape wide with no time/order variableHello. I am working with a dataset that has multiple observations for most of the identifiers labele…
covariates and distal outcomes in a latent class modelHi Statalist Is there a way to implement the 3-step Latent Class Analysis (to include the covariates…
Help trying to determine an Asymmetric effect for dummy variables in a Linear Random Effects ModelHello this is my first post here. So I am making a model to try and show the asymmetric effect in m…
Coefplot - multiple models with different dependent variablesAll, I am running multiple regressions with the same independent variable and 29 different dependent…
Subscribe to:
Post Comments (Atom)
0 Response to Randomly shuffling only one variable in Stata
Post a Comment