I have panel data, and am trying to construct a zscore variable for each panel. We used the egen newvar = std(oldvar) command, but this only gave us zscores based on the mean and standard deviation of the entire dataset.
Instead, I would like to have zscores calculated on the means and standard deviations of each panel. We assumed that, since we tsset the data as panel data, it would automatically do this, but this has not been the case.
We were able to use the "by" option to sum zscores under each panel - is there a similar option that allows you to take the zscores by each panel?
For more details, we are looking at different geographic areas over time. Each geographic area is a panel. We are trying to calculate the zscore of a flooding variable in each area so that we can see how much above or below a certain norm flooding levels were for each specific area.
Thanks
Instead, I would like to have zscores calculated on the means and standard deviations of each panel. We assumed that, since we tsset the data as panel data, it would automatically do this, but this has not been the case.
We were able to use the "by" option to sum zscores under each panel - is there a similar option that allows you to take the zscores by each panel?
For more details, we are looking at different geographic areas over time. Each geographic area is a panel. We are trying to calculate the zscore of a flooding variable in each area so that we can see how much above or below a certain norm flooding levels were for each specific area.
Thanks
Comment