BookmarkSubscribeRSS Feed
shenflow
Obsidian | Level 7

I have an unbalanced panel of a variable. That is, I have a panel of n time series of varying length. Each n denotes a firm. I conducted a t-test to compare the (unweighted) mean of the entire panel with 0. I did this by estimating an intercept only regression model. To account for autocorrelation at the firm level, I clustered the standard errors at the firm level. In SAS terms, this looks as follows (firm is the firm identifier):

proc surveyreg data = data;
	cluster firm;
	model variable = ;
run; 

I now want to repeat this test for the mean weighted by firms, i.e. the mean which is equally affected by each firm, irrespective of the number of observations per firm. Also, I still want want to explicitly take the autocorrelation at the firm level into account.

 

Is this possible?

 

EDIT: What I came up with now is to specify a weight variable that assigns each observation its respective weight according to the weighting I want to achieve (described above). I then include the WEIGHT statement in the proc surveyreg procedure, using the weighting variable. Everything else is held equal, i.e.:

proc surveyreg data = data;
	cluster firm;
	model variable = ;
    weight weightvariable;
run; 

Does this make sense?

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 1058 views
  • 0 likes
  • 1 in conversation