Using Locals to Store Results (Macros)
Using eth_allrounds_final.dta,
-
Summarize
yield_kgand store the mean and standard deviation from this command in locals namedmean_yieldandsd_yieldusingr(mean)andr(sd). Use these locals to create a standardized yield variable calledyield_std. Recall from your stats classes, to standardize a variable you subtract the mean value from the variable and then divide the difference by the standard deviation. What is the mean and standard deviation ofyield_std? -
Use the
displaycommand and your locals to print the following sentence “Mean yield on Ethiopian plots is`mean_yield'kg with standard deviation of`sd_yield'kg.”