Hello dear Stata users,
I have a little complicated task for my thesis and I am struggling to come up with the logically correct coding in stata.
Namely, I need the following sequence (I have a household dataset containing 2 countries - base and comparison):
1. Generate a sample of size N from base country
2. Run probit regression and save coefficients
3. Generate another sample of size N as well from comparison country
4. Apply stored probit coefficients for comparison country and predict y_hat (in my case homeownership rate)
5. Actual homeownership rate in base country (from the dataset) - y_hat from (4)
And this process should be repeated around 100-200 times in order to find the 95% confidence interval of differences. I am sure there should be looping involved, but I have no idea how to complete step 4. The loop I hope to figure out myself and I think it won't cause a big trouble.
Thanks,
Farogat.
I have a little complicated task for my thesis and I am struggling to come up with the logically correct coding in stata.
Namely, I need the following sequence (I have a household dataset containing 2 countries - base and comparison):
1. Generate a sample of size N from base country
2. Run probit regression and save coefficients
3. Generate another sample of size N as well from comparison country
4. Apply stored probit coefficients for comparison country and predict y_hat (in my case homeownership rate)
5. Actual homeownership rate in base country (from the dataset) - y_hat from (4)
And this process should be repeated around 100-200 times in order to find the 95% confidence interval of differences. I am sure there should be looping involved, but I have no idea how to complete step 4. The loop I hope to figure out myself and I think it won't cause a big trouble.
Thanks,
Farogat.
Comment