新农上路
- 积分
- 99
- 大米
- 颗
- 鳄梨
- 个
- 水井
- 尺
- 蓝莓
- 颗
- 萝卜
- 根
- 小米
- 粒
- 学分
- 个
- 注册时间
- 2022-7-24
- 最后登录
- 1970-1-1
|
****1.Input sample demographics data.;
data demog;
label subjid = "Subject Number"
trt ="Treatment". 1point3acres.com
gender ="Gender"
race ="Race"
age ="Age";
input subjid trt gender race age @@;. 1point3acres
datalines;
101 0 1 3 37 301 0 1 1 70 501 0 1 2 33 601 0 1 1 50 701 1 1 1 60
102 1 2 1 65 302 0 1 2 55 502 1 2 1 44 602 0 2 2 30 702 0 1 1 28
103 1 1 2 32 303 1 1 1 65 503 1 1 1 64 603 1 2 1 33 703 1 1 2 44
104 0 2 1 23 304 0 1 1 45 504 0 1 3 56 604 0 1 1 65 704 0 2 1 66
105 1 1 3 44 305 1 1 1 36 505 1 1 2 73 605 1 2 1 57 705 1 1 2 46
.google и106 0 2 1 49 306 0 1 2 46 506 0 1 1 46 606 0 1 2 56 706 1 1 1 75
201 1 1 3 35 401 1 2 1 44 507 1 1 2 44 607 1 1 1 67 707 1 1 1 46
202 0 2 1 50 402 0 2 2 77 508 0 2 1 53 608 0 2 2 46 708 0 2 1 55. 1point 3 acres
203 1 1 2 49 403 1 1 1 45 509 0 1 1 45 609 1 2 1 72 709 0 2 2 57
204 0 2 1 60 404 1 1 1 59 510 0 1 3 65 610 0 1 1 29 710 0 1 1 63
205 1 1 3 39 405 0 2 1 49 511 1 2 2 43 611 1 2 1 65 711 1 1 2 61
206 1 2 1 67 406 1 1 2 33 512 1 1 1 39 612 1 1 2 46 712 0 . 1 49
;
run;. check 1point3acres for more.
***2.Create formats needed for table rows.;
proc format;
value gender
1= "Male"
2= "Female";
value race
1= "White"
2= "Black"
3= "Other";
run;
****3.Duplicate the incoming date set for overall column;
****Calculations so now trt values 0=placebo,1=active and 2=overall; ..
data demog;. Waral dи,
set demog;. .и
output;
trt=2;
output;
run;
****Age statistics programming;
****Get P value from non parametric comparison of age means;
proc npar1way data=demog wilcoxon noprint;
where trt in (0,1);
class trt;
var age;
output out=pvalue wilcoxon;. .и
run;
. check 1point3acres for more.
proc sort data=demog;.1point3acres
by trt;
run;
. From 1point 3acres bbs
***Get age descriptive statistics N, Mean, STD,MIn,and max;
proc univariate data=demog noprint;
by trt;
var age;
output out=age n=_n mean=_mean std=_std min=_min max=_max;
run;
***Format age descriptive statistics for the table;
data age;
set age;. Waral dи,
format n mean sd min max $14.;
drop _n _mean _std _min _max;
n=put(_n,3.);
mean=put(_mean,7.1);
std=put(_std,8.2);
min=put(_min,7.1);
max=put(_max,7.1);
run;
*****Transpose age descriptive statistics into columns;
proc transpose data=age out=age prefix=col;
var n mean std min max;. 1point3acres
id trt;
run;
. From 1point 3acres bbs
****create age first row for the table;
data label;. 1point3acres.com
set pvalue(keep=P2_WIL rename=(P2_WIL=pvalue));
length label $85;.--
label="Age(years)";
run;
***Append age descriptive statistics to age p value row and;
***crete age descriptive statistics row labels.;
data age;
length label $85 co10 co11 co12 $25;
set label age; ..
keep label co10 co11 co12 pvalue;
if _n_ > 1 then
select;
when(_NAME_ = 'n') label = " N";
when(_NAME_ = 'mean') label = " Mean";
when(_NAME_ = 'std') label = " Standard Deviation";.1point3acres
when(_NAME_ = 'min') label = " Minimum";
. 1point 3acres when(_NAME_ = 'max') label = " Maximum";
otherwise;. Χ
end;
run;
求问各位大神,最后一步死活找不到bug,请帮忙看看哪里出问题。谢谢! |
|