suyusung / arm

Data Analysis Using Regression and Multilevel/Hierarchical Models
23 stars 6 forks source link

rescale returning different results each time. #21

Open kjayhan opened 2 years ago

kjayhan commented 2 years ago

When I use arm::rescale for each of my variables that I use in the plm, I get almost exactly the same result (same F, R2 etc.) as my raw data.

However, when I run the same code again after restarting Rstudio, I get a totally different result because arm::rescale produces a very different result next time. After some tries, I sometimes get the right results. Sometimes the wrong one. I have no idea how I get the right one (since I don't change anything in between the wrong and the right results).

What am I missing here?

FYI, my data is panel data.

mbojan commented 2 years ago

@kjayhan arm::rescale() is deterministic so given the same inputs will produce identical output each time. I suspect the problem is elsewhere in your scripts or the way you run them.

kjayhan commented 2 years ago

I guessed so. It probably had something to do with a for loop I had. Seems to be fine now.