BookmarkSubscribeRSS Feed
1 REPLY 1
Astounding
PROC Star

As a SAS layman, you will have a lot to learn to answer even the basic questions that you are asking.  I will get you started, but can't possibly present all the tools you will need.

First, I have to assume you already have a SAS data set although you don't explicitly name the data set or any of the variables within it.  Here are some tools that will serve you well in general, and will start the ball rolling.

First, create a SAS data set holding a count of how many observations exist for each FIRM:

proc freq data=full_dataset;

   tables firm / noprint out=firm_counts (keep=firm count);

run;

Next, merge this back onto the original data, and subset the observations:

proc sort data=full_dataset;

   by firm;

run;

data subset;

   merge full_dataset firm_counts;

   by firm;

   if count >= 40;

run;

This will generate another SAS data set holding just the FIRMs with at least 40 observations.  That seems to be part of what you asked for.  There is a lot more to it, as noted below.

If you have data from 1970 through 2010, you might have 41 observations rather than 40 for some firms.

Just because there are 40 observations, for a firm, it doesn't mean you have consecutive years.  There could be 40 observations all for the same firm for the same year.

Just because you have 40 observations, it doesn't mean they all contain valid data.  There could be blanks in many of the variables.

It will take a lot of work on your part to be able to address all of these questions.  I'm hoping this will get you started.

Good luck.


sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 678 views
  • 3 likes
  • 2 in conversation