@Kiko wrote:
Hi!
I am not sure if this is the right place to ask this type of question, but here I go. So currently, the SAS program I use generate a random sample of the event/outcome of interest for review. The process is quite manual, because once the review is complete, I have to update the status of those charts (e.g. review requested, review complete etc.) manually and make sure that they are excluded from the sample pool for next review. Also, I change LocID for a specific site.
Does the review process generate any output data set? With the Subjid? Is Subjid duplicated in your data set, possibly keeping track of a history, or is there only one record/status at a time for the subject?
If the subject doesn't appear in more than one LOCID then that really doesn't have much impact.
The question sort of becomes dependent on what you have. If your review process doesn't generate any data sets then somewhere some data entry will have to be done manually.
If you keep your OUT data set from surveyselect, likely with a better name, then you might be able to edit that in VIEWTABLE and use that to update your main study data set. But I'm not sure at what point you want to do that because you don't show any attempt at that.
I know that I do not see the logic of selecting based on multiple LOCID in the DATA STUDY step but then only using a single LOCID in the Proc Surveyselect code. If you are making multiple calls to surveyselect then likely sort the data set study by LOCID and then use LOCID as a STRATA variable. If all of the LOCID have the same sample size requirement that is very minor change to the code. If you need different sample sizes per LOCID then the sampsize parameter in surveyselect will take a list of values example:
proc sort data=sashelp.class out=work.class;
by age;
run;
proc surveyselect data=work.class out=work.sampled
sampsize=(4 3 2 3 2 2) selectall
;
strata age;
run;
Strata does require the data to be sorted. The Selectall option will select all of the available records if the strata does not have enough to fulfill the request. In this example there are only 2 age=11 and 1 age=16. The list in SAMPSIZE matches the sample request size to the sorted values of the Strata variable so requested 4 age=11 and 2 for age=16 so we get notes in the log about that but the data is as likely needed given the input.
... View more