Hello,
I am running a nested case-control sampling macro analysis matching on n=10 controls.
i.e..
proc surveyselect data=m4_case&i method=srs n=10 seed=2009 out=m6_case&i;
id IDnum case_id ctrl_id dx grp_cc;
run;
However, i get these messages when the matching number is less than 10;
ERROR: The sample size, 10, is greater than the number of sampling units, 9.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set M6_CASE2096 may be incomplete. When this step was stopped there were 0
observations and 5 variables.
I have relaxed my matching criteria to accommodate more case-control matches as possible.
For now i want to force the sas program to accept those n=9 etc to be matched using the same procedure stated above whilst still using the n=10 criteria. Pls any help will be welcome.
I replaced "PROC SURVEYSELECT" statement with SELECTALL as you suggested (find below) but got the error message:
6 selectall data=m4_case&i method=srs n=10 seed=2009 out=m6_case&i;
---------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
selectall data=m4_case&i method=srs n=10 seed=2009 out=m6_case&i;
id IDnum case_id ctrl_id dx grp_cc;
run;
Try adding the SELECTALL option without your PROC SURVEYSELECT statement.
I replaced "PROC SURVEYSELECT" statement with SELECTALL as you suggested (find below) but got the error message:
6 selectall data=m4_case&i method=srs n=10 seed=2009 out=m6_case&i;
---------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
selectall data=m4_case&i method=srs n=10 seed=2009 out=m6_case&i;
id IDnum case_id ctrl_id dx grp_cc;
run;
Just adhere to the syntax described in the documentation Reeza linked to: SELECTALL is an option of the PROC SURVEYSELECT statement, so it needs to be inserted anywhere into the list of the five options you're currently using (DATA=, METHOD=, N=, SEED=, OUT=).
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.