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
Bootstrapped SEs for quantile regressionHi, I have a standard difference-in-differences setup where a reform is introduced in one region in…
Prevalence with multiple variablesHello, I am analyzing a hospital dataset which provides demographic, diagnostic, and procedural data…
Estimation of Markov Switching modelsHi, I am estimating a Markov Switching models using the mswitch command. This code runs for country …
"No room to add more variables": Stata tries to load empty spreadsheetHi, I am trying to import an Excel spreadsheet the usual way but I am getting an error: Code: . im…
Replace "statsby" by "runby" to save timeHi, I am currently running regressions by group and saving coefficients using "statsby". It turns o…
Subscribe to:
Post Comments (Atom)
0 Response to Randomly shuffling only one variable in Stata
Post a Comment