I am attempting to write a program,wherein I wish to simulate the Central Limit Theorem (the result that the distribution of sample averages less the true mean and scaled by the standard deviation has a standard normal limiting distribution). As a result, I wrote the following code:
I obtain the error message: "Expression must be bound in parantheses". I fail to see how I have not done that. Any help is much appreciated.
Code:
program normal10, rclass drop _all quietly set obs 10 generate x= rnormal(0,1) sum x return scalar meanforonedraw=r(mean) return scalar stdevforonedraw=r(sd) end simulate Zn=(10^0.5)*(r(meanforonedraw)/r(stdevforonedraw)), reps(1000): normal10
Comment