peto-prentice广义Wilcoxon检验:
proc lifetest data = xx;
time time * censor(1);*** aval * cnsr(1) ***;
strata 分层因素 / group = trtpn test = peto adjust = dunnett diff = control("2");
*** control 控制,2为对照组,方法为peto,Dunnett法校正***;
run;
Bootstrap重复抽样构造数据集:
proc serveyselect data = xx seed = 20231231 out = dataset method = urs samprate = 1 reps = 500 outhits;
**seed: 随机种子, reps:重复次数***;
strata trtpn;
run;
proc univariate data = newdata;
class trtpn;
var diff; *** diff:中位时间的组间差异***;
output out = ci n = n pctlpts = 2.5, 97.5 patlpre = ci;
run;
Mantel-Haenszel(M-H)检验:
proc freq data = xx;
table 分层因素1 * 分层2 * trtpn * response /cmh2;
run;
协方差分析(ANCOVA):
*** method 1 ***;
proc glm data = xx;
class trtpn;
model chg = base trtpn / ss3; ***默认ss3,可选ss1,带base是协方差,不带base是直方差***;
lsmeans trtpn; ***lsmeans用于出最小二乘均数***;
run;
*** method 2 ***;
proc anova data = xx;
class trtpn;
model chg = trtpn base trtpn * base;
run;
5. 最小二乘均数:
proc glm data = xx;
class trtpn;
lsmeans trtpn; ***lsmeans用于出最小二乘均数***;
run;
6.非参Wilcoxon检验:
proc npar1way data = xx Wilcoxon DSCF;
class trtpn;
var xxx;
run;
7.Fisher精确检验:|
proc feq data = xx;
table trtpn * aval / exact;
run;
8.Clopper-Pearson确切法:
proc freq data = xx;
by trtpn;
tables response / out = xxx binomial(cl = exact level = '1');
ods output binomialcls = xxxxx;
run;
9.确切CMH检验:
proc logistic data = xx;
class trtpn 分层 / param = ref;
model response = trtpn;
strata 分层;
exact trtpn / extimate = odds;
run;
10.MI填补:
proc mi data = xx seed = nimpute = 100 out = mi;
var strata aval1 aval2;
mcmc chain = muitiple impute = monotone nbiter = 200 niter = 200;
by trtpn;
run;
proc sort data = mi; by _imputation_ trtpn usubjid strata
aval1 aval2; run;
proc mi data = mi seed = nimpute = 1 out = xxx;
class trtpn strata;
by _imputation_;
var trtpn strata aval1 aval2;
monotone reg ( aval2 );
run;
11.卡方检验(x²检验):
proc freq data = xx;
table trtpn / chisq;
run;
12.Newcombe法:
proc freq data = xx;
tables trtpn * aval / riskdiff(cl = newcombe)
nopercent ncol alpha = 0.1;
by ;
run;
13.Hodges-Lehmann法:
proc npar1way /* hl alpha = 0.05 */ data = xx;
class trtpn;
var aval; ***aval是需要检验的变量***;
*exact hl; ***加上hl表示只输出HL的检验结果***;
output out = xxx hl;
quit;
14.M-N(Miettinen-Nurminen):
proc freq data = xx;
tables trtpn * response / chisq fisher expected
riskdiff(cl = mn);
*** chisq卡方,fisher:fisher法***;
run;
15.Wald法:
proc freq data = xx;
tables trtpn * aval / riskdiff(cl = wald)
alpha = 0.05 crosslist;
run;
16.K-M和logrank计算P值:
proc lifetest data = xx method = km conftype = linear;
time aval * cnsr(1);
strata strata1 group = trtpn test = logrank;|
***strata1为分层因素***;
quit;
17.Cox风险比例模型计算HR和置信区间:
proc phreg data = xx;
class trtpn(ref = '2'); ***2为对照组***;
model aval * cnsr(1) = trtpn / ties = exact risklimits
/*=pl*/ appha = 0.05 selecion = none;
strata strata1;
hazardratio trtpn / diff = ref;
run;
初步小记,后续更新修正。
领取专属 10元无门槛券
私享最新 技术干货