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

 I have the following code:

Proc report data=year2_dpinsur;
	Title "Insurance Status";
	Column dpinsur YY4_DOB,Row_Percent YY4_DOB,Lower_CL YY4_DOB,Upper_CL dummyvar;
	Define	dpinsur / group;
	Define yy4_DOB / across;
	Define Row_Percent / display; 
		Define Lower_CL / display; 
		Define Upper_CL / display;
	define dummyvar / computed noprint;
	 compute dummyvar;
	 dummyvar = 1;
	 endcomp;
Run;

It produces this table:

Insurance Status

  Year Year Year
  2016 2017 2018 2019 2020 2016 2017 2018 2019 2020 2016 2017 2018 2019 2020
Prenatal Insurance Status Row Percent Row Percent Row Percent Row Percent Row Percent 95% Lower Confidence Limit, Row Pct 95% Lower Confidence Limit, Row Pct 95% Lower Confidence Limit, Row Pct 95% Lower Confidence Limit, Row Pct 95% Lower Confidence Limit, Row Pct 95% Upper Confidence Limit, Row Pct 95% Upper Confidence Limit, Row Pct 95% Upper Confidence Limit, Row Pct 95% Upper Confidence Limit, Row Pct 95% Upper Confidence Limit, Row Pct
Medicaid 39.83 38.41 34.13 45.03 37.50 34.87 33.74 29.52 38.98 31.63 44.80 43.08 38.73 51.07 43.36
None 1.79 1.89 0.29 1.42 0.60 0.22 0.46 0.00 0.00 0.00 3.37 3.31 0.68 2.92 1.37
Private 58.37 59.71 65.58 53.56 61.90 53.37 55.00 60.97 47.50 56.02 63.38 64.41 70.19 59.61 67.78

 

When what I really want is this layout below, where Row%, lower CL, and upper CL all follow each other under each corresponding year. But I can't figure out how to get that. When I tried YY4_DOB,Row, lower_CL, Upper_CL, it gave the error:

ERROR: There is more than one ANALYSIS usage associated with
the column defined by the following elements.

 

    Year  
    2016  
Prenatal Insurance Status Row Percent 95% Lower Confidence Limit, Row Pct 95% Upper Confidence Limit, Row Pct
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
	Column dpinsur YY4_DOB,(Row_Percent Lower_CL Upper_CL) dummyvar;

or as I would prefer to see it

 

	Column dpinsur YY4_DOB,(Lower_CL Row_Percent Upper_CL) dummyvar;

I think you also need

 

Define Row_Percent / sum; 
		Define Lower_CL / sum; 
		Define Upper_CL / sum;

 

--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26
	Column dpinsur YY4_DOB,(Row_Percent Lower_CL Upper_CL) dummyvar;

or as I would prefer to see it

 

	Column dpinsur YY4_DOB,(Lower_CL Row_Percent Upper_CL) dummyvar;

I think you also need

 

Define Row_Percent / sum; 
		Define Lower_CL / sum; 
		Define Upper_CL / sum;

 

--
Paige Miller

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
  • 1 reply
  • 530 views
  • 0 likes
  • 2 in conversation