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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1027 views
  • 0 likes
  • 1 in conversation