具体程序可检索“【论文题名】定性指标的SAS统计分析报表--SAS软件在新药临床试验统计分析中的应用(一) 【作 者】童新元 张高魁 姚晨 ”的论文作者: shiyiming 时间: 2004-6-2 22:20 标题: another solution 其实tomtalk基本都解决了,就差一点点。比如:
[code:11798]
data class;
set sashelp.class;
if ranuni(111)>.5 then do;
type='药物一';
if ranuni(123)>.5 then id='A';
else id='B';
end;
else do;
type='药物二';
if ranuni(234)>.5 then id='A';
else id='B';
end;
run;
proc print;run;
ods html file="c:\123.htm" style=statdoc;
proc tabulate data=class;
class sex type id;
var age;
table sex age*(mean median max min),type*id;
run;quit;
ods html path='c:\'(url=none) body='1.htm' ;
proc tabulate data=class;
class sex type id;
var age;
table sex age*(mean median max min),type*id;
run;quit;
ods html close;
LOG:
ERROR: Read Access Violation In Task ( Submit ]
Exception occurred at (63CC5C0D)
Task Traceback
ods html path='c:\'(url=none) body='1.htm' ;
NOTE: Writing HTML Body file: 1.htm
ERROR: Generic critical error.
editor的状态也不正常,始终显示“正在处理提交的任务中”作者: shiyiming 时间: 2004-6-3 11:37 标题: 假如还要求在求得mean的基础上,出95%置信区间的结果呢? 用哪个过程可以出n nmiss mean std median qrange 同时还要95%CI.
hehe,搞定了。应该是proc means里面的lclm和uclm选项。作者: shiyiming 时间: 2004-6-3 13:40 标题: A conventional way to do this table It is a typical demographic table in clinical trial analysis. Although it might be created by PROC TABULATE, I still suggest all of you trying to write a SAS program in a more complicated way as follows (at least as a home work assignment).
1. Use Proc Freq to calculate the frequencies and percentage, save the result into a SAS data set.
2. Use Proc Means to calculate means and stds and save the result into a SAS data set.
3. reformulate each columns and append the two result data sets.
4. create table by Proc Report.
The way to do this is generally referred as customized reporting, which means to create a report based on given template.
In the previous example, if I make just small changes to that table structure, Proc Tabulate will never do it.
Using the default output of a PROC, the flexibility of the output format is very limited. A good SAS programmer should be able to follow the requirements exactly, in case the requiremements are reasonable. It is a key difference between the people working in industry and academic fields.
It is for sure that any kind of report can be created by using PUT statement, but that kind of skill is rarely used with the standardization of clinical trial reporting.
Just my 2 cents.作者: shiyiming 时间: 2004-6-4 10:18 标题: 想实现第三步,请给个简单例子 3. reformulate each columns and append the two result data sets.作者: shiyiming 时间: 2004-6-5 18:33 标题: reformulate the columns For example, you have two data sets, each has two columns and one record.
In data A, x=345, y=342;
In data B, x=4.56 (23%), y=2.34 (56%);
You want a talbe printed out as
EXP of A 345 342
EXP of B 4.56 (23%) 2.34 (56%)
Since x and y in B are defintely character variables, if x and y in A are numeric, you have to convert them into character variables before you append A and B together. Besides, you have to add EXPlainations to each row. I refer these operations as reformaulte columns.作者: shiyiming 时间: 2004-11-29 20:15 标题: Re: SAS如何输出如下的表格? 请问一个我想了好久的问题 各位大淫帮忙
一个数据集在报表输出时要求部分在左边输出一部分在右边输出格式如下
data temp;
input year sort sort1 var1;
cards;
nike 1bf 10
nike 2bf 20
nike 3bf 30
nike 4bf 40
adi 1bf 12
adi 2bf 13
adi 3bf 24
adi 4bf 30
ban 1bf 10
ban 2bf 12
ban 3bf 31
ban 4bf 34
kwi 1bf 10
kwi 2bf 12
kwi 3bf 31
kwi 4bf 34
;
run;