E****2 发帖数: 247 | 1 请教大家一个问题:
At first, I used,
proc phreg data = pfsdays;
class trt;
model ept*eptcen(1) = trt / rl;
assess var = (trt) ph;
run;
I got : ERROR: Cannot assess the functional form of ATRSORT since it is not
a continuous explanatory variable.
Then I created a numeric var, trtpn, 0, 1 correspoding to two treatment
groups. No error. And I got
two plots for the assess statemetns, Cumulative Martingale function form,
and Standardized Score Process Plot
ods graphics on;
proc ... 阅读全帖 |
|
l*******s 发帖数: 6 | 2 请教一个SAS PROC PHREG 的问题:
在用proc phreg 作 Bayesian 分析的时候,参数为 Categorical variable, class 在
model 之前,但在 设定 prior (Normal distribution, 要求建立dataset, 包含
mean 和 SD). 时, SAS 要求输入 Class variable 每个 level 的 prior, 请问这些
prior 应该都一样吗? 还是参照的level 设为 0?
谢谢 高人指点 |
|
l********l 发帖数: 10 | 3 我想fit一个Cox phreg.用的是如下的code:
proc tphreg data=fortest;
class trtgrp sex race;
model days*censor(0)=trtgrp sex race;
strata site;
output out=curve survival=est;
run;
这儿trtgrp=treatment group; days=survival time; censor=event/no event.
得到的survival probility 保存在curve,结果试图画图时发现curve dataset有以下问
题:
survival probility不是随survival time的增加而递减的阶梯函数。
不知道是什么地方出的问题,牛人们能给指点一下吗?
BTW,我用的是sas 9.1 |
|
m******1 发帖数: 19713 | 4 I am running a multivarialbe model:
model survtime*death(0)=A B A*B.
Is there a way to output the score test statistic and likelihood ratio test
statistic for A*B from Proc PHREG?
Thanks. |
|
m******3 发帖数: 734 | 5 proc phreg貌似有个proportional hazard的assumption
lifetest可以有别的option, 不一定ph |
|
b******w 发帖数: 52 | 6 I tied to use phreg for time-dependent covariate.
According to sas, "No BASELINE data set is created if the counting process
style of input is used or if the model contains a time-dependent variable".
I would like to get the cumulative baseline hazard function \Lambda_0(t) or
the hazard function with all the covariates = 0.
could somebody tell me how to get \Lambda_0(t)? and even kindly point out
how to get h_0(t)?
Thanks! |
|
s****t 发帖数: 651 | 7 做一个PHREG,其中一个变量的OR estimate和95% CI are:
1307.119 49.947 34207.56
is this too big? |
|
s*****h 发帖数: 232 | 8 用phreg estimate OR (odds ratio)??? |
|
a********s 发帖数: 188 | 9 I am not sure about SAS PROC PHREG, but in a general Bayesian modeling, say,
Y = beta0 + beta1*X;
we can specify a normal distribution like
beta0, beta1 ~ N(0, 1E5)
Both reference level and other levels should have priors. They could be the
same, or they can be different. |
|
s***n 发帖数: 392 | 10 请高人指点……
我用cox proportional hazard model分析cohort数据,outcome是death,用proc
phreg。前人发给我的一个model是这么写的:
exit_age*death= X Y Z/entry=entry_age
其中exit_age和entry_age分别是每个人出、进cohort的年龄。我觉得这个model没有
adjust for age,就把entry_age也写到model等号右边去了,作为第四个covariate。
结果,这个entry_age的effect算出来竟然是负的——年纪越大,死亡率越低,这显然
不合理。
于是我自己算了个exit_time(用exit_age减去entry_age),把model写成:
exit_time*death= X Y Z entry_age
这样entry_age的effect就是正的了,两个model的X Y Z的parameter estimate倒是差
不多。但是我想不通的是,为什么用第一个model,再adjust entry_age就错了呢?这
两个model的区别究竟是什... 阅读全帖 |
|
w******8 发帖数: 59 | 11 Dear all, I am running this procedure for time dependent covariates. I also
have two time INDEPENDENT covariates: Age at baseline which is continuous;
HIVPatient ( a status indicating whether having HIV) which is binary.
The following codes works fine without adding HIVPatient, but I don't
understand why there is nothing estimated for HIVPatient once I included it.
I think this is weird. Could someone help me?
Thanks!
proc phreg data = OnePer;
class HIVPatient(PARAM=Reference Ref='0');
mod... 阅读全帖 |
|
e****t 发帖数: 766 | 12 in proc phreg, the results from "type 3 test " will change if i change the
coding method. (1 vs 0 or 1 vs 2) , i put the variable in class statement
already. ideally, it will be the same , as I consider as categorical data.
. the coding wont have impact...
(the analysis of MLE part will change as the coding change will leave to
main effect definition changes.. dont know why type 3 changes too.. )
anybody knows the reasons ?
Many thanks in advance ? |
|
t*******0 发帖数: 64 | 13 对age>20的病人,用Cox model, predictor包括age, RACE="B"(character variable:
e.g. A, B, C, O), medhistory(0,1 variable)。 要找出每个predictor的HR 及
Confidence Interval, p-value.
1)下面的code对不对?
2)age>20能不能在proc phreg里规定?
3)RACE="B"的coding 对不对?还有没有别的方法?
data b;
set a;
if age>20;
if RACE="A" or RACE="C" or RACE="O" then R=0;
if RACE="B" then R=1;
run;
proc phreg data=b;
model time*censor(0)=age R medhistory/risklimits;
baseline out=temp2 survival=survival;
run; |
|
t********m 发帖数: 939 | 14 Obs ID MONTHS SEQ EVENT DAYS AGE BMI
1 1 0 1 0 0.001 40 27.39999962
2 1 12 2 0 411 41 26.5
3 1 24 3 0 778 42 26.29999924
4 1 36 4 0 1169 43 26.20000076
5 1 48 5 0 1504 44 26
6 1 60 6 0 1911 45 26.39999962
7 1 72 7 0 2225 46 26.10000038
8 1 84 8 0 2612 47 27.60000038
9 2 0 1 0 0.001 50 24.7... 阅读全帖 |
|
t********m 发帖数: 939 | 15 大侠大侠,能多说两句么?如果做interval censored survival analysis,还是用
proc phreg么?是不是这种形式:
proc phreg data=test;
model (t_start,t_end)*event(0)=age bmi;
id id months event;
run;
但data要怎么处理一下才能用这个啊?google了一下,似乎有关这方面的资料挺少的。
请大侠指点,谢谢! |
|
t********m 发帖数: 939 | 16 多谢回复。我现在用的是另外的data structure,就是每个id只有一个record ,程序
如下:
proc phreg data=flatcox;
model months*event(0)=ag1 bmi htn diur ckd creat /risklimits;
array bm(*) bm1-bm8;
array ht(*) ht1-ht8;
array di(*) di1-di8;
array ck(*) ck1-ck8;
array cr(*) cr1-cr8;
bmi=bm[seq]; htn=ht[seq]; diur=di[seq];
ckd=ck[seq]; creat=cr[seq];
run;
我现在就是困惑怎样将data弄成适合用counting process的structure,我需要建两个
新的variable,一个为开始的time,一个为结束的time,然后用如下的程序:
proc phreg data=counting;
id id seq;
model (s... 阅读全帖 |
|
e****t 发帖数: 766 | 17 也报个offer,临床统计, PhD, experienced. 工作从7月份开始找到现在, 主
要是当前工作的公司在裁人,安全起见, 所以开始骑驴找马。 Recruiter 电话很多,
但是到HM 只有5个, 三个onsite, 1 个offer。 也算圆满了。工资少了些, 主要是
离LD 从250 mile 变成 90 mile, 钱不是很重要了。 有点遗憾的是, 绿卡又得从新
开始了。
还记得一些面试题, 回馈本版, 谢谢其他贴面经的朋友。
Linear regression: basic assumptions, how to diagonistic,
if violate any assumption, how to handle
Bootstrap basic idea.
Bayesian theory/Frequetist difference. How to explain to non statistician.
What is empirical Bayesian?
What is difference between logrank test and wilco... 阅读全帖 |
|
g**r 发帖数: 425 | 18 DATA STEP是必须要搞熟的,除了读入文件DO LOOP什么的,
retain, first. last.; date format,这些都不在话下
MACRO很重要,很重要很重要;但MACRO学起来是很容易的,比DATA STEP
容易好多
PROC TABULATE (or PROC REPORT);要搞搞熟的,这个很重要
Haworth的 PROC TEBULATE BY Example是值得花时间读一读的
我痛恨胡乱用PROC TABULATE的PROGRAMMER,那么强的工具,经常被人
糟塌--明明三五行就解决的事情,楞写出百十行来,让人看的那个难受。
直观易懂的PROC MEANS, PROC FREQ当然不用说了
PROC GPLOT和PROC GCHART要翻一翻的,AXIS,PATTERN, LENGEND,SYMBLO什么的
临时学倒是来的及。但人家问你的时候你要知道SAS GRAPH这回事情。
如果是搞TRIAL的,PROC LIFETEST, PROC PHREG要看一看的;
否则的话,PROC REG, PROG LOGISTIC, PROC GLM翻翻 |
|
m*****e 发帖数: 13 | 19 Hi all,
I am always confused about determining K (number of free parameters) when
compute AIC for logistic regression and cox regression.
In my understanding, K = # of free parameters including the interceptor (if
available) and estimated residual error.
For logistic regression, this means K = npred + 1 + 1 (npred = number of
predictors not including the intercept);
For cox regression, this means K = npred + 1.
But this is different from SAS, which does not take into account of the
estimated res |
|
s*********k 发帖数: 1989 | 20 听说对cancer research, survival analysis(PHREG etc) 很有用.
有人有experience吗?
说说听听, 比如你是医生, 有一些病人的information, 咋去建立一
survival analysis 的model. |
|
c**********e 发帖数: 2007 | 21 Use proc lifetime. It is the parametric approach.
proc reliability in SAS/QC is the same as proc lifetime
in SAS/STAT. Be careful for left censored case, one
of them requires left bound as 0 while the other requires
missing (use .).
For interval censored data, SAS only has parametric
approach. For other data, SAS has nonparametric, i.e.,
Kaplan-Meier (proc lifetest), and even more popular
semi-parametric approach. i.e., Cox regression (proc
phreg). |
|
e*******e 发帖数: 75 | 22 我再用survival analysis 作分析的时候,用了下面的程序却发现问题:
%macro eun5(var1,var2,var3,var4,var5,var1T,var2T,var3T,var4T,var5T);
PROC PHREG DATA=ONE;
MODEL SURV*CENSOR(1)= &VAR1 &VAR2 &VAR3 &VAR4 &VAR5 &VAR1T &VAR2T &VAR3T &
VAR4T &VAR5T;
&VAR1=VAR1*LOG(SURV);
&VAR2=VAR2*LOG(SURV);
&VAR3=VAR3*LOG(SURV);
&VAR4=VAR4*LOG(SURV);
&VAR5=VAR5*LOG(SURV);
PROPORTIONALITY_TEST: TEST &VAR1T, &VAR2T, &VAR3T, &VAR4T, &VAR5T;
%MEND;
%EUN5 (YR1,YR2,YR3,YR4,YR5,YR1T,YR2T,YR3T,YR4T,YR5T);
最后总是出现:
error: variable var5 is not found |
|
W**********E 发帖数: 242 | 23
我最近也碰到类似问题。我的想法:
1.
K-M CURVE 是UNADJUSTED. 但是你用TPHREG的话,你估计的SURVIVAL PROBABILITIES
ADJUSTED FOR COVARIATES(S(T)=S(T)0^EXP(BETA*X))。 SURVIVAL
PROBABILITIES 不仅仅随时间变化,也随这些COVARIATES数值的变化而变化.
打个比方,1月内生存概率S(T)应该比第2个月的高。但由于这些协变量X1,X2,
X3。那么不一定,有可能接受治疗+男性+白人第2月内比不治疗+女性+黑人第1月内
的生存概率反而高。
但你作图又无法考虑这些协变量的不同值的话,就出现上下波动,虽然趋势可能也是往下。
2.
用tphreg这个参数来输出SURVIVAL PROBABLITIES。你自己仔细看MANUAL
baseline out=; |
|
l********l 发帖数: 10 | 24 谢谢解答!看了一些reference,感觉清楚了一些。 |
|
|
m******1 发帖数: 19713 | 26 Thanks.
It helps with outputing likelihood ratio test statistic. What about score
test?
If it is an univariate model, score and LR tests can be outputed using ods using the global test results. However, my model is a multivariable model. |
|
p*****0 发帖数: 3104 | 27 看到了一些的区别 但是不知道有没有看出本质来
多谢! |
|
|
m*******s 发帖数: 469 | 29 proc univariate
proc freq
proc glm
proc lifetest
proc phreg
proc mixed
真正弄懂玩透这几个SAS命令,药厂95%的project可以应付了。 |
|
s****t 发帖数: 651 | 30 conditional logistic regression |
|
r****r 发帖数: 6957 | 31 不正常。是不是sparse data,尤其一组有0 event?如果是这样,你需要用profile
likelihood method |
|
o****o 发帖数: 8077 | 32 'if then' programming statements are valid in many PROCs, such as PHREG,
NLMIXED, NLIN, to name a few |
|
d*******o 发帖数: 493 | 33 1)下面的code对不对?
As long as it can be run
2)age>20能不能在proc phreg里规定?
where age>20;
3)RACE="B"的coding 对不对?还有没有别的方法?
You can do dummy variable
B: 0 0
A: 1 0
C: 0 1
D: 1 1 |
|
d*******o 发帖数: 493 | 34 twitter兄,我看了半天没明白,我猜你是不是这个意思啊
proc phreg data=one;
class race(ref='B');
model time*censor(0)=age R medhistory/risklimits;
hazardratio 'Race' race /diff=ref cl=both;
where age >20;
run; |
|
t*******0 发帖数: 64 | 35 谢谢你的回复!
题目如下: 对age>20的病人,用Cox model, 要找出每个predictor的HR 及
Confidence Interval, p-value.
predictor包括:
1. age
2. RACE="B"(B代表Africa American)
3. medhistory(0,1 variable)。
我的code如下:我把B(African american)归为一类(R=1), 其他的RACE合在一起为一
类(R=0),不知道这样对不对。你的code为什么把Race="B"作为referen cell? 而你
model后面却用R?
============================================
data b;
set a;
if age>20;
if RACE="A" or RACE="C" or RACE="O" then R=0;
if RACE="B" then R=1;
run;
proc phreg data=b;
model time*censor(0)=age R medhistory/risklimit |
|
d*******o 发帖数: 493 | 36 应该这样吧
proc phreg data=one(where=(age>20));
class race(ref='B') medhistory;
model time*censor(0)=age race medhistory/risklimits;
run; |
|
t*******0 发帖数: 64 | 37 太谢谢dapangmao!
不知道为什么要用下面一句?我在SAS里看到class是红色的, 而且run了一下有如下出
错信息: proc phreg 里能用class吗?
113 class RACE(ref='B') medhistory;
-----
180
ERROR 180-322: Statement is not valid or it is used out of proper order. |
|
t*******0 发帖数: 64 | 38 你是不是用的proc tphreg, 而不是proc phreg,能告诉我怎么测试吗? 我用我的
dataset运行通不过,谢谢!! |
|
l*********s 发帖数: 5409 | 39 Phreg is a experimental procedure in sas 9.13 and officially incorporated in
9.2. It is very likely the errors are due to the fact that your SAS version
is too old. |
|
B******y 发帖数: 9065 | 40 PROC REPORT, MEANS, FREQ, GLM and LOGISTICS,包括换汤不换药的有UNIVARIATE,
MIXED, GENMOD等,基本上涵括了90%以上的工作。剩下的10%就为PROC LIFETEST,
PHREG,POWER,PLAN等等了。 |
|
n******0 发帖数: 298 | 41 When there is a dummy explanatory variable X such that all observations
having one of the values of X (0 or 1) occur in censored observations, the
Cox regression model does not converge. How to deal with it? |
|
j********t 发帖数: 40 | 42 在sas中用phreg,sas怎么知道是left censored,right censored还是interval的呢?
还请各位牛人帮忙解惑 :) |
|
Y******Y 发帖数: 8753 | 43 phreg不能accommodate left censoring的情况,lifereg可以,不过fit的不是
semiparametric cox
model... |
|
g**********1 发帖数: 399 | 44 want to see 2 treatment difference.
treatment 放在class trt;
和不用class,直接放 model 里,
有啥区别呢?
居然p-value一个是 >0.05,另一个是<0.05?
谢了 |
|
P****D 发帖数: 11146 | 45 Just use ASSESS PH; to test for the ph assumption. The continuous variables
you put in VAR=() are tested for functional forms. |
|
E****2 发帖数: 247 | 46 Thanks a lot!!
I am confused. The ph checking is specific for a variable. For one variable,
the ph maybe is OK while for another variable maybe it is not OK. Right?
variables |
|
E****2 发帖数: 247 | 47 有哪位高手能给指点吗? 我周围的人也都不熟悉。或者,有什么地方能去问吗?
多谢了!!
not |
|
P*****4 发帖数: 55 | 48 在RUN proc phreg 模型的时候,如果变量太多了,但由于各个变量之间的interaction
,导致stepwise那些模型都是把变量全选。
在这种情况下,要怎样做啊 |
|
r*****y 发帖数: 199 | 49 简单来说,我要每次simulation生成一个dataset A,对A做一些分析,一共
simulate100000次,因为每次生成的A太大,所以不方便直接生成一个含有100000个A叠
加起来的dataset。具体code如下:
%MACRO DOIT(N);
%DO sim=1 %TO &N;
...这里generate A(每次seed=sim);
ods output ParameterEstimates=B;
proc phreg data=A;
...
proc append base=B_all data=B;
run;
%END;
%MEND DOIT;
就是不知道为什么append不起来我要的data,有没有熟悉macro和append的高手指点一
下,另外如果append的base是空白,就想把每个macro循环生成的B 放到一个新的
dataset里面,有没有更好更简单的方法呢? |
|
|