BookmarkSubscribeRSS Feed
manya92
Fluorite | Level 6

Hi all, 

 

I wrote this code to calculate the Incidence Rate of few patients in my dataset. 

*making the IR table;
proc sql ;
	create table _04_allinf_IR as 
	select count(enrolid) as N
			,sum(post_ind) as  events
			,sum(PY) as Person_Years
			,(SUM(post_ind)/SUM(PY))*100000 as IR
			,CINV(0.025,2*SUM(post_ind))/(2*SUM(PY))*100000 as Lower95
			,CINV(0.975,2*(SUM(post_ind)+1))/(2*SUM(PY))*100000 as Upper95
	from _04_PY ;
quit ;

 

but I am getting this error. How to resolve this ?

*making the IR table;
68         proc sql ;
69         	create table _04_allinf_IR as
70         	select count(enrolid) as N
71         			,sum(post_ind) as  events
72         			,sum(PY) as Person_Years
73         			,(SUM(post_ind)/SUM(PY))*100000 as IR
74         			,CINV(0.025,2*SUM(post_ind))/(2*SUM(PY))*100000 as Lower95
75         			,CINV(0.975,2*(SUM(post_ind)+1))/(2*SUM(PY))*100000 as Upper95
76         	from _04_PY ;
NOTE: Invalid argument 2 to function CINV. Missing values may be generated.
NOTE: Table WORK._04_ALLINF_IR created, with 1 rows and 6 columns.

 

2 REPLIES 2
tomrvincent
Rhodochrosite | Level 12
Probably dividing by zero.
ChrisNZ
Tourmaline | Level 20

Or probably =0.

Create a variable with the value of the second argument since that's where the error is

, 2*SUM(post_ind) as ARG

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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