Counting companies observation in the sample.

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

Counting companies observation in the sample.

Hello!

I have the following problem...

I posses a very large sample of companies over the years.

I wanted to count how many observations there are for each unique company name.

Have:

year, company,

1990, A

1991,A

1992,A

1993,A

1994,A

1995,A

1990,B

1991,B

1992,B

1993,B

Wanna:

company, freq

A, 6

B, 4

I would really appreciate your time and concern...


Accepted Solutions
Solution
‎05-17-2014 07:25 AM
Trusted Advisor
Posts: 1,204

Re: Counting companies observation in the sample.

Try this.

proc sql;

select company,count(*) as freq

from have

group by company;

quit;

View solution in original post


All Replies
Solution
‎05-17-2014 07:25 AM
Trusted Advisor
Posts: 1,204

Re: Counting companies observation in the sample.

Try this.

proc sql;

select company,count(*) as freq

from have

group by company;

quit;

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 175 views
  • 0 likes
  • 2 in conversation