Using the "Test Statement" and Options in Proc Reg

Reply
New Contributor
Posts: 4

Using the "Test Statement" and Options in Proc Reg

I have a dataset that consists of three primary types of observations: (1) Targets, (2) Peers and (3) Neither a Target nor Peer.  Each observation has financial data (assets, liabilities, revenues, etc.).  The entire population is approximately 65,000 observations (2,000 Targets, 50,000 Peers and 13,000 Neithers).  I have a dummy variable assigned as Pre_Peer = 1 if the Peer observation occurs before an event, 0 otherwise and Post_Peer = 1 if the Peer observation occurs after an event, 0 otherwise.  All 65,000 observations have this dummy variable included, but ONLY the Peers can have Pre_Peer = 1 or Post_Peer = 1 (all Targets and Neithers are 0 for both dummies).

Here is an example of the dataset:

Observation     Pre_Peer     Post_Peer

Target 1          0                    0

Target 2          0                    0

Target 3          0                    0

Neither 1          0                    0

Neither 2          0                    0

Peer 1              1                    0

Peer 2              1                    0

Peer 3              0                    0

Peer 4              0                    1

Peer 5              0                    0

As shown above, not all Peers are assigned to Pre_Peer or Post_Peer (therefore, I suppose these therefore become "Neithers").

The following is my Proc Reg:

Proc Reg data=AllFirms Outest=ReplicationModel;

Title 'Replication Results';

Model ResidsModel = Pre_Peer Post_Peer Control_Variables Year_Dummies;

Test Pre_Peer = Post_Peer;

Run;

Quit;

My goal is to determine if there is a difference between Pre_Peer and Post_Peer (i.e. an F-test), as shown in the TEST statement above.  However, obviously for the Targets and Neithers (and Peer Observations that do not meet the criteria for Pre_Peer or Post_Peer), there is no difference between Pre_Peer and Post_Peer because both are equal to 0.  I need the entire 65,000 observations in the Proc Reg.  But, how can I use the Test Statement for only those observations that are "Peers" with Pre_Peer or Post_Peer = 1 (and excluding the Targets and Neithers)?

Basically, I'm looking for something like "If the firm observation is a Peer Firm AND has either Pre_Peer = 1 OR Post_Peer = 1, THEN Test if Pre_Peer = Post_Peer".  Any tips/suggestions/comments are greatly appreciated!  Thanks!!!

Ask a Question
Discussion stats
  • 0 replies
  • 101 views
  • 0 likes
  • 1 in conversation