Dear All:
My portion of my data set is as follows:
Date ID Var
Mar1 A 1
Mar1 A 3
Mar1 A 10
Mar1 A 4
Mar1 A 5
Mar1 B 4
Mar1 B 5
Mar1 B 7
Mar2 A 2
Mar2 A 0
Mar2 A 3
Mar2 A 4
Mar2 A 1
Mar2 A 1
Mar2 B 9
Mar2 B 7
Mar2 B 6
Mar2 B 8
I want three categories
0-1 Category 1
2-5 Category 2
6-10 Category 3
My Table should look like
A PercentA B PercentB
Mar1
0-1 1 20% 0 0%
2-5 3 60% 2 67%
6-10 1 20% 1 33%
Mar2
0-1 3 60% 0 0%
2-5 2 40% 4 100%
6-10 0 0% 0 0%
Please help
|
|
0
|
|
|
|
Reply
|
randistan69 (204)
|
12/14/2009 12:16:12 PM |
|
proc format ;
value catfmt 0-1='Category 1'
2-5='Category 2'
6-10='Category 3';
run;
proc tabulate data=have;
class date var ID;
table date*var='',ID*(N*f=8. pctn<var>='%'*f=8.)/misstext='0';
format var catfmt.;
run;
HTH
Yu
On Mon, Dec 14, 2009 at 6:16 AM, Randy <randistan69@hotmail.com> wrote:
> Dear All:
> My portion of my data set is as follows:
>
> Date ID Var
> Mar1 A 1
> Mar1 A 3
> Mar1 A 10
> Mar1 A 4
> Mar1 A 5
> Mar1 B 4
> Mar1 B 5
> Mar1 B 7
> Mar2 A 2
> Mar2 A 0
> Mar2 A 3
> Mar2 A 4
> Mar2 A 1
> Mar2 A 1
> Mar2 B 9
> Mar2 B 7
> Mar2 B 6
> Mar2 B 8
>
> I want three categories
> 0-1 Category 1
> 2-5 Category 2
> 6-10 Category 3
>
> My Table should look like
>
> A PercentA B PercentB
> Mar1
> 0-1 1 20% 0 0%
> 2-5 3 60% 2 67%
> 6-10 1 20% 1 33%
> Mar2
> 0-1 3 60% 0 0%
> 2-5 2 40% 4 100%
> 6-10 0 0% 0 0%
>
> Please help
>
|
|
0
|
|
|
|
Reply
|
zhangyu05 (659)
|
12/14/2009 2:58:24 PM
|
|
If there is no observation in a particular category how do get SAS to say 0
observations and 0%?
Randy
On Mon, 14 Dec 2009 07:16:12 -0500, Randy <randistan69@HOTMAIL.COM> wrote:
>Dear All:
>My portion of my data set is as follows:
>
>Date ID Var
>Mar1 A 1
>Mar1 A 3
>Mar1 A 10
>Mar1 A 4
>Mar1 A 5
>Mar1 B 4
>Mar1 B 5
>Mar1 B 7
>Mar2 A 2
>Mar2 A 0
>Mar2 A 3
>Mar2 A 4
>Mar2 A 1
>Mar2 A 1
>Mar2 B 9
>Mar2 B 7
>Mar2 B 6
>Mar2 B 8
>
>I want three categories
>0-1 Category 1
>2-5 Category 2
>6-10 Category 3
>
>My Table should look like
>
> A PercentA B PercentB
>Mar1
>0-1 1 20% 0 0%
>2-5 3 60% 2 67%
>6-10 1 20% 1 33%
>Mar2
>0-1 3 60% 0 0%
>2-5 2 40% 4 100%
>6-10 0 0% 0 0%
>
>Please help
|
|
0
|
|
|
|
Reply
|
randistan69 (204)
|
12/14/2009 11:57:53 PM
|
|
You can add the "printmiss" option:
proc tabulate data=have;
class date var ID;
table date*var='',ID*(N*f=8. pctn<var>='%'*f=8.)/misstext='0' *printmiss*;
format var catfmt.;
run;
Hope this helps.
Sid
On Mon, Dec 14, 2009 at 5:57 PM, Randy <randistan69@hotmail.com> wrote:
> If there is no observation in a particular category how do get SAS to say 0
> observations and 0%?
> Randy
>
> On Mon, 14 Dec 2009 07:16:12 -0500, Randy <randistan69@HOTMAIL.COM> wrote:
>
> >Dear All:
> >My portion of my data set is as follows:
> >
> >Date ID Var
> >Mar1 A 1
> >Mar1 A 3
> >Mar1 A 10
> >Mar1 A 4
> >Mar1 A 5
> >Mar1 B 4
> >Mar1 B 5
> >Mar1 B 7
> >Mar2 A 2
> >Mar2 A 0
> >Mar2 A 3
> >Mar2 A 4
> >Mar2 A 1
> >Mar2 A 1
> >Mar2 B 9
> >Mar2 B 7
> >Mar2 B 6
> >Mar2 B 8
> >
> >I want three categories
> >0-1 Category 1
> >2-5 Category 2
> >6-10 Category 3
> >
> >My Table should look like
> >
> > A PercentA B PercentB
> >Mar1
> >0-1 1 20% 0 0%
> >2-5 3 60% 2 67%
> >6-10 1 20% 1 33%
> >Mar2
> >0-1 3 60% 0 0%
> >2-5 2 40% 4 100%
> >6-10 0 0% 0 0%
> >
> >Please help
>
|
|
0
|
|
|
|
Reply
|
nsid31
|
12/15/2009 12:23:39 AM
|
|
I am making a mistake somewhere
proc format ;
value catfmt 0-1='Category 1' ;
2-10 ='Category 2' ;
11-20 ='Category 3';
21-30 ='Category 4';
31-40 ='Category 5'
41-50 ='Category 6';
51-60 ='Category 7';
61-70 ='Category 8';
71-80 ='Category 9' ;
81-90 ='Category 10';
91-100 ='Category 11';
run;
proc tabulate data = Have;
class date var ID;
table date*var='',ID*(N*f=8. pctn<var>='%'*f=8.)
/misstext='0' printmiss ;
format var catfmt.;
run;
When i run the code I am getting categories 12 13 14 etc....
What is my mistake?
On Mon, 14 Dec 2009 18:23:39 -0600, Sid N <nsid31@GMAIL.COM> wrote:
>You can add the "printmiss" option:
>
>proc tabulate data=have;
>class date var ID;
>
>table date*var='',ID*(N*f=8. pctn<var>='%'*f=8.)/misstext='0' *printmiss*;
>format var catfmt.;
>run;
>
>Hope this helps.
>
>Sid
>
>On Mon, Dec 14, 2009 at 5:57 PM, Randy <randistan69@hotmail.com> wrote:
>
>> If there is no observation in a particular category how do get SAS to say 0
>> observations and 0%?
>> Randy
>>
>> On Mon, 14 Dec 2009 07:16:12 -0500, Randy <randistan69@HOTMAIL.COM> wrote:
>>
>> >Dear All:
>> >My portion of my data set is as follows:
>> >
>> >Date ID Var
>> >Mar1 A 1
>> >Mar1 A 3
>> >Mar1 A 10
>> >Mar1 A 4
>> >Mar1 A 5
>> >Mar1 B 4
>> >Mar1 B 5
>> >Mar1 B 7
>> >Mar2 A 2
>> >Mar2 A 0
>> >Mar2 A 3
>> >Mar2 A 4
>> >Mar2 A 1
>> >Mar2 A 1
>> >Mar2 B 9
>> >Mar2 B 7
>> >Mar2 B 6
>> >Mar2 B 8
>> >
>> >I want three categories
>> >0-1 Category 1
>> >2-5 Category 2
>> >6-10 Category 3
>> >
>> >My Table should look like
>> >
>> > A PercentA B PercentB
>> >Mar1
>> >0-1 1 20% 0 0%
>> >2-5 3 60% 2 67%
>> >6-10 1 20% 1 33%
>> >Mar2
>> >0-1 3 60% 0 0%
>> >2-5 2 40% 4 100%
>> >6-10 0 0% 0 0%
>> >
>> >Please help
>>
|
|
0
|
|
|
|
Reply
|
randistan69 (204)
|
12/15/2009 2:07:46 AM
|
|
Randy,
Remove the misplaced semicolons. I.e.,
proc format ;
value catfmt 0-1='Category 1'
2-10 ='Category 2'
11-20 ='Category 3'
21-30 ='Category 4'
31-40 ='Category 5'
41-50 ='Category 6'
51-60 ='Category 7'
61-70 ='Category 8'
71-80 ='Category 9'
81-90 ='Category 10'
91-100 ='Category 11';
run;
HTH,
Art
--------
On Mon, 14 Dec 2009 21:07:46 -0500, Randy <randistan69@HOTMAIL.COM> wrote:
>I am making a mistake somewhere
>
>
>proc format ;
>value catfmt 0-1='Category 1' ;
>2-10 ='Category 2' ;
>11-20 ='Category 3';
>21-30 ='Category 4';
>31-40 ='Category 5'
>41-50 ='Category 6';
>51-60 ='Category 7';
>61-70 ='Category 8';
>71-80 ='Category 9' ;
>81-90 ='Category 10';
>91-100 ='Category 11';
>run;
>
>proc tabulate data = Have;
>class date var ID;
>table date*var='',ID*(N*f=8. pctn<var>='%'*f=8.)
>/misstext='0' printmiss ;
>format var catfmt.;
>run;
>
>
>When i run the code I am getting categories 12 13 14 etc....
>What is my mistake?
>
>On Mon, 14 Dec 2009 18:23:39 -0600, Sid N <nsid31@GMAIL.COM> wrote:
>
>>You can add the "printmiss" option:
>>
>>proc tabulate data=have;
>>class date var ID;
>>
>>table date*var='',ID*(N*f=8. pctn<var>='%'*f=8.)/misstext='0' *printmiss*;
>>format var catfmt.;
>>run;
>>
>>Hope this helps.
>>
>>Sid
>>
>>On Mon, Dec 14, 2009 at 5:57 PM, Randy <randistan69@hotmail.com> wrote:
>>
>>> If there is no observation in a particular category how do get SAS to
say 0
>>> observations and 0%?
>>> Randy
>>>
>>> On Mon, 14 Dec 2009 07:16:12 -0500, Randy <randistan69@HOTMAIL.COM>
wrote:
>>>
>>> >Dear All:
>>> >My portion of my data set is as follows:
>>> >
>>> >Date ID Var
>>> >Mar1 A 1
>>> >Mar1 A 3
>>> >Mar1 A 10
>>> >Mar1 A 4
>>> >Mar1 A 5
>>> >Mar1 B 4
>>> >Mar1 B 5
>>> >Mar1 B 7
>>> >Mar2 A 2
>>> >Mar2 A 0
>>> >Mar2 A 3
>>> >Mar2 A 4
>>> >Mar2 A 1
>>> >Mar2 A 1
>>> >Mar2 B 9
>>> >Mar2 B 7
>>> >Mar2 B 6
>>> >Mar2 B 8
>>> >
>>> >I want three categories
>>> >0-1 Category 1
>>> >2-5 Category 2
>>> >6-10 Category 3
>>> >
>>> >My Table should look like
>>> >
>>> > A PercentA B PercentB
>>> >Mar1
>>> >0-1 1 20% 0 0%
>>> >2-5 3 60% 2 67%
>>> >6-10 1 20% 1 33%
>>> >Mar2
>>> >0-1 3 60% 0 0%
>>> >2-5 2 40% 4 100%
>>> >6-10 0 0% 0 0%
>>> >
>>> >Please help
>>>
|
|
0
|
|
|
|
Reply
|
art297 (4237)
|
12/15/2009 2:41:51 AM
|
|
IS it possible to flip the rows and columns
so now the output should look like
0-1 2-5
Date Mar1
A
Percent A
B
Percent B
Mar1
A
Percent A
B
Percent B
On Mon, 14 Dec 2009 21:41:51 -0500, Arthur Tabachneck <art297@NETSCAPE.NET>
wrote:
>Randy,
>
>Remove the misplaced semicolons. I.e.,
>
>proc format ;
>value catfmt 0-1='Category 1'
>2-10 ='Category 2'
>11-20 ='Category 3'
>21-30 ='Category 4'
>31-40 ='Category 5'
>41-50 ='Category 6'
>51-60 ='Category 7'
>61-70 ='Category 8'
>71-80 ='Category 9'
>81-90 ='Category 10'
>91-100 ='Category 11';
>run;
>
>HTH,
>Art
>--------
>On Mon, 14 Dec 2009 21:07:46 -0500, Randy <randistan69@HOTMAIL.COM> wrote:
>
>>I am making a mistake somewhere
>>
>>
>>proc format ;
>>value catfmt 0-1='Category 1' ;
>>2-10 ='Category 2' ;
>>11-20 ='Category 3';
>>21-30 ='Category 4';
>>31-40 ='Category 5'
>>41-50 ='Category 6';
>>51-60 ='Category 7';
>>61-70 ='Category 8';
>>71-80 ='Category 9' ;
>>81-90 ='Category 10';
>>91-100 ='Category 11';
>>run;
>>
>>proc tabulate data = Have;
>>class date var ID;
>>table date*var='',ID*(N*f=8. pctn<var>='%'*f=8.)
>>/misstext='0' printmiss ;
>>format var catfmt.;
>>run;
>>
>>
>>When i run the code I am getting categories 12 13 14 etc....
>>What is my mistake?
>>
>>On Mon, 14 Dec 2009 18:23:39 -0600, Sid N <nsid31@GMAIL.COM> wrote:
>>
>>>You can add the "printmiss" option:
>>>
>>>proc tabulate data=have;
>>>class date var ID;
>>>
>>>table date*var='',ID*(N*f=8. pctn<var>='%'*f=8.)/misstext='0' *printmiss*;
>>>format var catfmt.;
>>>run;
>>>
>>>Hope this helps.
>>>
>>>Sid
>>>
>>>On Mon, Dec 14, 2009 at 5:57 PM, Randy <randistan69@hotmail.com> wrote:
>>>
>>>> If there is no observation in a particular category how do get SAS to
>say 0
>>>> observations and 0%?
>>>> Randy
>>>>
>>>> On Mon, 14 Dec 2009 07:16:12 -0500, Randy <randistan69@HOTMAIL.COM>
>wrote:
>>>>
>>>> >Dear All:
>>>> >My portion of my data set is as follows:
>>>> >
>>>> >Date ID Var
>>>> >Mar1 A 1
>>>> >Mar1 A 3
>>>> >Mar1 A 10
>>>> >Mar1 A 4
>>>> >Mar1 A 5
>>>> >Mar1 B 4
>>>> >Mar1 B 5
>>>> >Mar1 B 7
>>>> >Mar2 A 2
>>>> >Mar2 A 0
>>>> >Mar2 A 3
>>>> >Mar2 A 4
>>>> >Mar2 A 1
>>>> >Mar2 A 1
>>>> >Mar2 B 9
>>>> >Mar2 B 7
>>>> >Mar2 B 6
>>>> >Mar2 B 8
>>>> >
>>>> >I want three categories
>>>> >0-1 Category 1
>>>> >2-5 Category 2
>>>> >6-10 Category 3
>>>> >
>>>> >My Table should look like
>>>> >
>>>> > A PercentA B PercentB
>>>> >Mar1
>>>> >0-1 1 20% 0 0%
>>>> >2-5 3 60% 2 67%
>>>> >6-10 1 20% 1 33%
>>>> >Mar2
>>>> >0-1 3 60% 0 0%
>>>> >2-5 2 40% 4 100%
>>>> >6-10 0 0% 0 0%
>>>> >
>>>> >Please help
>>>>
|
|
0
|
|
|
|
Reply
|
randistan69 (204)
|
12/15/2009 4:57:18 AM
|
|
|
6 Replies
110 Views
(page loaded in 0.093 seconds)
Similiar Articles: Proc Tabulate - comp.soft-sys.sasHi All, Below is a simplified code for illustation purposes. The CARDS statement represents responses to a survey. Three individuals each gave resp... can proc tabulate do the ratio of sums? - comp.soft-sys.sas ...I have heard that I can make proc tabulate calculate the ratio of two columns, but I can't figure out how to do it. For example if I want the share ... how could the ODS Output dataset be output via xls similar to ...how could the ODS Output dataset be output via xls similar to Tabulate that created it? Tweet Create an HTML report from this dataset - comp.soft-sys.sas ...Preferably, it would have a crosstab layout like FREQ or TABULATE would produce. I can easily get PROC PRINT to generate a report but it looks just like the dataset. SAS Beginner Pls Help - comp.soft-sys.sasNOTE: PROCEDURE TABULATE used (Total process time): real time 0.06 seconds cpu time 0.01 seconds Re: Creating one report with columns based on different subsets ...Date: Wed, 30 Dec 2009 22:17:04 -0500 This is a natural for PROC TABULATE. If you wanted a block for non- switchers it would be pretty simple. How to generate a table with proc means - comp.soft-sys.sas ...On Apr 4, 12:55=EF=BF=BDam, Patrick <patrick.mat...@gmx.ch> wrote: > If possible: First combine the 3 datasets into one and then use Proc > Tabulate (or Proc Report). Variable Labels in a Proc Freq? - comp.soft-sys.sasUse proc tabulate instead to control the labels...too hard to manage in proc freq IMO. If you put sample proc freq code, I'm sure you could get help converting to ... Data Structure Using Proc Transpose - comp.soft-sys.sasIn those cases you should step back and consider using Proc TABULATE or REPORT to output what you want. Perhaps you will not need those extra steps that create ... Comparison of regression slopes and intercepts - comp.soft-sys.sas ...Comparison of regression slopes and intercepts - comp.soft-sys.sas ... can proc tabulate do the ratio of sums? - comp.soft-sys.sas ... Comparison of regression slopes ... Tabulate - Definition and More from the Free Merriam-Webster ...Definition of TABULATE. transitive verb. 1: to put into tabular form . 2: to count, record, or list systematically — tab·u·la·tion \ ˌ ta-byə-ˈ lā-shən\ noun tabulate: Definition from Answers.comtabulate tr.v. , -lated , -lating , -lates . To arrange in tabular form; condense and list. To cut or form with a plane surface 7/27/2012 10:58:12 PM
|