BookmarkSubscribeRSS Feed
France
Quartz | Level 8

dear all,

 

how could I make the statistic for the following data? 

for example

 

 

psn_name, 200001,200002,200003,200004,200005,200006,...,201012

apple, 1,3,4....,9

qwe,3,6,8,....,6

eee,9,6,7,8...,4
....

the psn_name is the name of the company. the variable between 200001 and 201012 is the period from  Jan 2000 to Dec 2015. the number is the application each company make in the month.

 

I would like to make the statistic for the number of application companies made during this period.  could you please give me some suggestion?

 

thanks in advance.

best regards.

12 REPLIES 12
Reeza
Super User

Transpose your data (PROC TRANSPOSE)

PROC MEANS/FREQ should be all you need from that point forward.

 


@France wrote:

dear all,

 

how could I make the statistic for the following data? 

for example

 

 

psn_name, 200001,200002,200003,200004,200005,200006,...,201012

apple, 1,3,4....,9

qwe,3,6,8,....,6

eee,9,6,7,8...,4
....

the psn_name is the name of the company. the variable between 200001 and 201012 is the period from  Jan 2000 to Dec 2015. the number is the application each company make in the month.

 

I would like to make the statistic for the number of application companies made during this period.  could you please give me some suggestion?

 

thanks in advance.

best regards.


 

France
Quartz | Level 8

dear Reeza, 

 

thanks for your advice, I have transpose my data,

and now it looks like 

 

 

 

        apple, microsoft, fff,.....
200001  1,     2,    1
200002  2,     4,    3
...
201012  9,     5,    7

the number is the patent application made by each company per month.

 

how could I get the statistic results of them?

 

may I use the

PROC UNIVARIATE data=name;
RUN;

 cause there are too many companies in this dataset, may I get the result if I use PROC UNIVARIATE?

 

many thanks in advance.

 

Reeza
Super User

I may have missed this somewhere but what do you want as the result?

 


@France wrote:

dear Reeza, 

 

thanks for your advice, I have transpose my data,

and now it looks like 

 

 

 

        apple, microsoft, fff,.....
200001  1,     2,    1
200002  2,     4,    3
...
201012  9,     5,    7

the number is the patent application made by each company per month.

 

how could I get the statistic results of them?

 

may I use the

PROC UNIVARIATE data=name;
RUN;

 cause there are too many companies in this dataset, may I get the result if I use PROC UNIVARIATE?

 

many thanks in advance.

 


 

Reeza
Super User

You probably just want a proc means now.

 

proc means data=have stackods sum;
var apple--[last variable];
ods output summary=want;
run;

proc print data=want(obs=5);
run;
France
Quartz | Level 8

Dear Reeza, 

i just find after I Transpose the old data which like this,

TIM图片201809112251141.png

 

 

 

 

 

the variable name of the new dataset change as COL1, COL 2...etc.

 

TIM图片20180911225010.png

the company name is listed in the first column. could you give me some suggestion to fix it please ?

 

Reeza
Super User
You didn't specify an ID variable.
France
Quartz | Level 8
thanks for your reply, but what should i do for it?
Reeza
Super User

Specify the ID variable, either in the GUI or in the code. Did you use an ID statement?

Without seeing your code I have no clue what you did, so I can only respond in generalities. If you need specific solution, you have to include more information, preferably from the start. 

 

France
Quartz | Level 8

please see the private message, I also add the dataset in the attachment. please check if you like.

Reeza
Super User

I responded via PM, but please keep the discussion public. The forum is both to answer your questions but to help future users and taking the discussion private, does not support that. 

France
Quartz | Level 8

Dear Reeza, thanks for your reply. I will do this in the future.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 12 replies
  • 864 views
  • 0 likes
  • 3 in conversation