BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Crystal_F
Quartz | Level 8

Hi,

I wonder if there is any easy way to modify my code below to generate 95% CI associated with the column percentage in each cell. 

 

proc tabulate data=test2 missing noseps;

class score_cat  Age65_lst1yr cat_avg_ip ;

class cat_race_re Cat_raceeth ;

table score_cat,(all Age65_lst1yr*cat_avg_ip*cat_race_re Age65_lst1yr*cat_avg_ip*Cat_raceeth)*(n*f=comma8. colPctN*f=4.1);

run;

All variables above are categorical ones with multiple levels. Any suggestion would be greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Not in Tabulate for any of PCTN, COLPCTN, ROWPCTN or PAGEPCTN statistics. The statistics LCLM and UCLM for confidence limits may only be applied to VAR variables, or in other words, numeric variables that appear on a VAR statement.

 

So you need different data.

Or a different procedure that will produce confidence limits of proportions such as SURVEYFREQ to create the data of the summary desired and then display that data with a report procedure.

 


@Crystal_F wrote:

Hi,

I wonder if there is any easy way to modify my code below to generate 95% CI associated with the column percentage in each cell. 

 

proc tabulate data=test2 missing noseps;

class score_cat  Age65_lst1yr cat_avg_ip ;

class cat_race_re Cat_raceeth ;

table score_cat,(all Age65_lst1yr*cat_avg_ip*cat_race_re Age65_lst1yr*cat_avg_ip*Cat_raceeth)*(n*f=comma8. colPctN*f=4.1);

run;

All variables above are categorical ones with multiple levels. Any suggestion would be greatly appreciated!


 

View solution in original post

2 REPLIES 2
ballardw
Super User

Not in Tabulate for any of PCTN, COLPCTN, ROWPCTN or PAGEPCTN statistics. The statistics LCLM and UCLM for confidence limits may only be applied to VAR variables, or in other words, numeric variables that appear on a VAR statement.

 

So you need different data.

Or a different procedure that will produce confidence limits of proportions such as SURVEYFREQ to create the data of the summary desired and then display that data with a report procedure.

 


@Crystal_F wrote:

Hi,

I wonder if there is any easy way to modify my code below to generate 95% CI associated with the column percentage in each cell. 

 

proc tabulate data=test2 missing noseps;

class score_cat  Age65_lst1yr cat_avg_ip ;

class cat_race_re Cat_raceeth ;

table score_cat,(all Age65_lst1yr*cat_avg_ip*cat_race_re Age65_lst1yr*cat_avg_ip*Cat_raceeth)*(n*f=comma8. colPctN*f=4.1);

run;

All variables above are categorical ones with multiple levels. Any suggestion would be greatly appreciated!


 

Crystal_F
Quartz | Level 8
That is very helpful! Thanks for your inputs!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 990 views
  • 1 like
  • 2 in conversation