I have unbalanced panel data. I have to compute standard deviation for a variable for the past five years recursively.
For example, standard deviation of the variable X for the year 2000 is computed based the observations from 1995 to 1999; for the year 2001, from 1996 to 2000 and so on.
As I have unbalanced panel, I am getting difficulty in making computation in SAS
Anybody please help me out with this.
Thanks in advance
You haven't specified how to handle this lack of balance in the computation of the standard deviation, and so we really can't advise you until that is specified.
thanks Mr. PaigeMiller for your prompt reply.
if there is no any observation for any the preceding five years data of the variable, i want to take only the available number of years for computation of standard deviation.
I think this is the only alternative which can be implemented easily. of course at the cost of accuracy.
please help me writing the SAS code
thanks in advance
@srikanthyadav44 wrote:
thanks Mr. PaigeMiller for your prompt reply.
if there is no any observation for any the preceding five years data of the variable, i want to take only the available number of years for computation of standard deviation.
I think this is the only alternative which can be implemented easily. of course at the cost of accuracy.
please help me writing the SAS code
thanks in advance
Do we treat each available observation equally? Or do we account for the lack of balance in some way? If year 1996 has 3 data points and 1997 has 400 data points, do we treat this as 403 data points, or do we weight 1996 somehow to be equal in importance to 1997?
Dear paigemiller
can you please suggest me the SAS code, for computing standard deviation recursively for the balanced panel data?
thanks in advance
I'd like to help, but you haven't answered my question.
dear Mr. PaigeMiller
greetings of the day
for the computation of standard deviation, I would like to give equal weightage to all the time series observations.
please help me writing the code.
thanks in advance
If you have the license for SAS/ETS consider using PROC EXPAND. If that doesn't work for some reason you need to post example data and explain what issues you're running into.
https://gist.github.com/statgeek/07a3708dee1225ceb9d4aa75daab2c52
https://gist.github.com/statgeek/27e23c015eae7953eff2
@srikanthyadav44 wrote:
I have unbalanced panel data. I have to compute standard deviation for a variable for the past five years recursively.
For example, standard deviation of the variable X for the year 2000 is computed based the observations from 1995 to 1999; for the year 2001, from 1996 to 2000 and so on.
As I have unbalanced panel, I am getting difficulty in making computation in SAS
Anybody please help me out with this.
Thanks in advance
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.