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
Cross Classified Model using Panel DataHello, I'm trying to run a cross classified model using panel data and I was hoping to get some hel…
Issue with PMG estimatorHi, I'm new to Stata. I have a panel data which contains 6 sub-groups. There are two inputs GDP (L…
Wald Test with binary predictor - does this make sense?Hi there, to evaluate my logistic regression model I am planing to perform a wald test. Besides my …
2sls testsfirst stage reg health variables predict healthpred,xb second stage probit schoolenroll healthpred …
Rolling regression on id units sub-intervalsDear All, I have a panel dataset and I would like to “rolling” regress my dependent variable on a ma…
Subscribe to:
Post Comments (Atom)
0 Response to Randomly shuffling only one variable in Stata
Post a Comment