Presentation is loading. Please wait.

Presentation is loading. Please wait.

How to realize random in SAS Professor: Lijue Student: Zhengliang

Similar presentations


Presentation on theme: "How to realize random in SAS Professor: Lijue Student: Zhengliang"— Presentation transcript:

1 How to realize random in SAS Professor: Lijue Student: Zhengliang

2 The definition of random
Random sampling and random grouping Random sampling :each element of the population has an equal chance of been selected. Ensuring representative of sample. Random grouping: each element of the population has an equal chance entering different groups(n ge 2). Ensuring the balance between groups.---Today’s presetation

3 Random-1 data ccc; do number=1 to 240; r=UNIFORM(2011);output; end;
proc rank data=ccc out=ddd; ranks r_rank; var r;run; data eee; set ddd; if r_rank<=120 then group='A'; else group='B';run; proc print;run; PROC PRINT NOOBS; VAR number group; RUN;

4 Random-2 proc plan seed=2011;
factors block=40 length=6; output out=fff; run; data ggg; SET fff; number=_n_; if length <=3 then group='A group'; else group='B group'; PROC PRINT NOOBS; VAR number group; RUN;

5 Pscore and Non-random Calculate the propensity score of every objects by employing a logistic regression, then have quintile stratification to get a new sample of which the covariates reaches the balance between treatment group and control group. Statistic and analyze the non-randomized clinical trial data with quintile stratification method, and the imbalance of concomitant variable between two groups were adjusted. In situation where randomized trials are not feasible, propensity score is an effective means to analyze the observational data.

6 SAS code data pscore01; input id x1-x4 treatment; cards; …… run;
proc logistic; model treatment=x1-x4; output out=pscoredat pred=pscore; proc print data=pscoredat;

7 Thanks for your suggestions


Download ppt "How to realize random in SAS Professor: Lijue Student: Zhengliang"

Similar presentations


Ads by Google