random - sas,how to randomly assign a patient to a clinic if he/she goes to multiple clinics -


I would like to analyze the compliance rate at the clinic level, but I have a lot of patients who are related to many clinics. I want to give a random clinic to each such patient. How does anyone know how to do this? I read proc surveys, proc plans, but not to make sure how to do it.

Thanks a long time ago!

If you are just looking for a clinic at random, then proc of survey Select is in the data at the time of making the works fine, see the code below. n = 1 says that choose a record at each level.

  is the data; Do the patient = 1 to 20; Clinic = 1 to ceiling (3 * rand ('uniform')); Output; End; End; Run; Proc SurveyElected Data = Outside = wantn = 1 seed = 12345; Class patient; Run;   

If the patient happens multiple times in the same clinic, then that clinic will be more likely to be selected; If you do not want that, the first / dipped by the patient / clinic

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -