Re: [R] p value of trends for odds ratios (or hazard ratios)

2014-01-06 Thread zhu yao
* *Department of UrologyFudan University Shanghai Cancer CenterShanghai, China* 2014/1/5 Michael Friendly frien...@yorku.ca On 1/4/2014 12:39 AM, zhu yao wrote: Dear Sir Many papers calculated the p value of trends for odds ratios of ordered category variables. I have found the tabodds command

Re: [R] p value of trends for odds ratios (or hazard ratios)

2014-01-05 Thread zhu yao
Thanks peter. *Yao Zhu* *Department of UrologyFudan University Shanghai Cancer CenterShanghai, China* 2014/1/5 peter dalgaard pda...@gmail.com On 04 Jan 2014, at 13:56 , zhu yao mailzhu...@gmail.com wrote: Thanks for the suggestion. The results is presented in following table

[R] change the reference level in plot(summary(cph-fit))

2014-01-04 Thread zhu yao
I have use the plot(summary(cph-fit)) to plot the hazard ratio plot. *Can I change the reference level in the plot, for example, use [1999, 2002) as the reference level?* *Thanks* *Yao Zhu* *Department of Urology Fudan University Shanghai Cancer CenterShanghai, China* [[alternative

[R] p value of trends for odds ratios (or hazard ratios)

2014-01-03 Thread zhu yao
Dear Sir Many papers calculated the p value of trends for odds ratios of ordered category variables. I have found the tabodds command in Stata. But how to do it in R? Thanks *Yao Zhu* *Department of UrologyFudan University Shanghai Cancer CenterShanghai, China* [[alternative HTML

Re: [R] how to plot growth chart like this

2013-02-11 Thread zhu yao
Thank you very much for the reference about methodology. I will try the GAMLESS package. *Yao Zhu* *Department of Urology Fudan University Shanghai Cancer Center Shanghai, China* 2013/2/11 David Winsemius dwinsem...@comcast.net On Feb 10, 2013, at 11:36 PM, zhu yao wrote: Dear R-users I

[R] how to extent the improveProb for survival data

2011-10-10 Thread zhu yao
Dear R users Function improveProb in the rms library calculate NRI and IDI for predictions of binary outcome. Do anyone extent its use in survival data? Many thanks. *Yao Zhu* *Department of Urology Fudan University Shanghai Cancer Center Shanghai, China* [[alternative HTML version

[R] How to retrieve bias-corrected probability from calibrate.rms

2011-09-01 Thread zhu yao
Dear R users: In Prof. Harrell's library rms, calibrate.rms plot the Bias-corrected Probability and Apparent Probability. The latter one can be retrieved from class calibrate.default. But how to retrieve the former one. BW *Yao Zhu* *Department of Urology Fudan University Shanghai Cancer Center

Re: [R] How to retrieve bias-corrected probability from calibrate.rms

2011-09-01 Thread zhu yao
Thanks Frank I got the predicted probability. But can I get the bootstrap corrected probability for individual subject. for instance, I can get predicted probability from predict(fit, type=fitted). Is there similar one to retrieve the bootstrap corrected probability for individual subject.

Re: [R] How to make a nomogam and Calibration plot

2011-08-03 Thread zhu yao
Nomogram is user-friendly, but the equation is also acceptable. It should be kept in mind that the process of model development really counts. BTW: You can calculate C-index (AUC) in SPSS. Calibration plot can also be plotted (may be manually) from the result of SPSS. *Yao Zhu* *Department of

[R] validate survival with val.surv

2011-07-14 Thread zhu yao
Dear R users: I want to externally validate a model with val.surv. Can I use only calculated survival (at 1 year) and actual survival? Or I needed the survival function and actual survival. Thanks *Yao Zhu* *Department of Urology Fudan University Shanghai Cancer Center Shanghai, China*

Re: [R] Error of Cross Validation

2011-06-20 Thread zhu yao
error in pre[sam[[j]], i] - predict(fit, data = dat[sam[[j]], ]) : * Yao Zhu* *Department of Urology Fudan University Shanghai Cancer Center Shanghai, China* 2011/6/20 Jim Holtman jholt...@gmail.com what was the error? Sent from my iPad On Jun 20, 2011, at 1:34, zhu yao mailzhu

[R] Error of Cross Validation

2011-06-19 Thread zhu yao
Dear R users: Recently, I tried to write a program to calculate cross-validated predicted value. My sources are as follows. However, the R reported an error. Could you please check the sources? Thanks. set.seed(100) x-rnorm(100) y-sample(rep(0:1,50),replace=T) dat-data.frame(x,y) library(rms)

[R] nonparametric logistic regression based on locally weighted scatterplot smoothing (lowess)

2011-06-04 Thread zhu yao
Dear UseRs: Recently, I have read an article regarding the association between age and lymph node metastases. http://jco.ascopubs.org/content/27/18/2931.long In statistical analysis, the authors stated Because a nonlinear relationship between age and lymph node involvement was expected based on

[R] question about val.surv in R

2011-05-08 Thread zhu yao
Dear R users: I tried to use val.surv to give an internal validation of survival prediction model. I used the sample sources. # Generate failure times from an exponential distribution set.seed(123) # so can reproduce results n - 1000 age - 50 + 12*rnorm(n) sex -

[R] Different results of coefficients by packages penalized and glmnet

2011-05-01 Thread zhu yao
Dear R users: Recently, I learn to use penalized logistic regression. Two packages (penalized and glmnet) have the function of lasso. So I write these code. However, I got different results of coef. Can someone kindly explain. # lasso using penalized library(penalized)

[R] How to answer the question about transitive correlation?

2011-04-21 Thread zhu yao
Hi, everyone. I know it may be a basic statistical question. But I can't find a good answer. I have a question raised by one of the reviewers. Factor A expression was strongly correlated with B expression (chi-square) in this series. Prior reports by the same authors showed that B expression

[R] tansformation of variables in cph from rms package

2011-02-25 Thread zhu yao
Dear all: I have used the cph function in the rms package. log10 was used to transform the variables, as follows: fit-cph(pfsurv~log10(x1)+log10(x2),x=T,y=T,surv=T) after I run the nomogram function. I found variable limits and transformations are such that an infinite axis value has resulted.

[R] bootstrap in pROC package

2010-10-13 Thread zhu yao
Dear useRs: I use pROC package to compute the bootstrap C.I. of AUC. The command was as follows: roc1-roc(all$D,all$pre,ci=TRUE,boot.n=200) However, the result was: Area under the curve: 0.5903 95% CI: 0.479-0.7016 (DeLong) Why the C.I. was computed by the Delong Method? Yao Zhu Department

[R] Is there a similar R function like stpower in STATA

2010-06-20 Thread zhu yao
Dear R users: In stat, there is a stpower function for power analysis and sample-size determination in survival models. Is there a counterpart in R? Thanks Yao Zhu Department of Urology Fudan University Shanghai Cancer Center Shanghai, China [[alternative HTML version deleted]]

Re: [R] Continous variables with implausible transformation?

2010-06-03 Thread zhu yao
THX Yao Zhu Department of Urology Fudan University Shanghai Cancer Center Shanghai, China 2010/6/4 Frank E Harrell Jr f.harr...@vanderbilt.edu On 06/03/2010 11:32 AM, Joris Meys wrote: You're right, it is the same. using I() won't work for the same reason sqrt don't, so : x2- x^2

[R] Continous variables with implausible transformation?

2010-06-02 Thread zhu yao
Dear r users I have a question in coding continuous variables in logistic regression. When rcs is used in transforming variables, sometime it gives implausible associations with the outcome although the model x2 is high. So what's your tips and tricks in coding continuous variables. P.S. How

Re: [R] I have a question on nomograms.

2010-03-26 Thread zhu yao
Totally agreed. Nomogram (or rank table, score table) is just a nice presentation of the model. The development and evaluation of the model is the one that matters. In order to develop a good model, you have to know how to manipulate the data, how to make your model better and suitable. These work

[R] cross validation function translated from stata

2010-01-21 Thread zhu yao
Hi, everyone: I ask for help about translating a stata program into R. The program perform cross validation as it stated. #1. Randomly divide the data set into 10 sets of equal size, ensuring equal numbers of events in each set #2. Fit the model leaving out the 1st set #3. Apply the fitted

Re: [R] cross validation function translated from stata

2010-01-21 Thread zhu yao
Center Shanghai, China 2010/1/21 zhu yao mailzhu...@gmail.com Hi, everyone: I ask for help about translating a stata program into R. The program perform cross validation as it stated. #1. Randomly divide the data set into 10 sets of equal size, ensuring equal numbers of events in each set

[R] could not find function Varcov after upgrade of R?

2009-09-12 Thread zhu yao
After upgrading R to 2.9.2, I can't use the anova() fuction. It says could not find function Varcov . What's wrong with my computer? Help needed, thanks! Yao Zhu Department of Urology Fudan University Shanghai Cancer Center No. 270 Dongan Road, Shanghai, China [[alternative HTML version

Re: [R] could not find function Varcov after upgrade of R?

2009-09-12 Thread zhu yao
/12 zhu yao mailzhu...@gmail.com: After upgrading R to 2.9.2, I can't use the anova() fuction. It says could not find function Varcov . What's wrong with my computer? Help needed, thanks! Yao Zhu Department of Urology Fudan University Shanghai Cancer Center No. 270 Dongan Road

Re: [R] about the summary(cph.object)

2009-08-02 Thread zhu yao
On Aug 1, 2009, at 8:53 PM, zhu yao wrote: Thx for your reply. In this example, age was transformed with rcs. So the output was different between f and summary(f). If I need to publicate the results, how do I explation the hazard ratio of age? 2009/8/1 David Winsemius dwinsem

Re: [R] about the summary(cph.object)

2009-08-01 Thread zhu yao
Thx for your reply. In this example, age was transformed with rcs. So the output was different between f and summary(f). If I need to publicate the results, how do I explation the hazard ratio of age? 2009/8/1 David Winsemius dwinsem...@comcast.net On Jul 31, 2009, at 11:24 PM, zhu yao wrote

[R] about the summary(cph.object)

2009-07-31 Thread zhu yao
Could someone explain the summary(cph.object)? The example is in the help file of cph. n - 1000 set.seed(731) age - 50 + 12*rnorm(n) label(age) - Age sex - factor(sample(c('Male','Female'), n, rep=TRUE, prob=c(.6, .4))) cens - 15*runif(n) h -

Re: [R] How to add 95% confidence intervals in the calibration plot?

2009-07-26 Thread zhu yao
/a9/c8/8b/c01aad248a0b4ae6ef677600614bd4fa.jpg 2009/7/26 Frank E Harrell Jr f.harr...@vanderbilt.edu zhu yao wrote: Dear experts: I am a newbie to R. Recently, I try to make prediction models with R and the Design library. I have read Prof. Harrell's excellent book. But I did not quite

[R] How to add 95% confidence intervals in the calibration plot?

2009-07-25 Thread zhu yao
Dear experts: I am a newbie to R. Recently, I try to make prediction models with R and the Design library. I have read Prof. Harrell's excellent book. But I did not quite understand. I have two problems about the validation and calibration of prediction models: 1. Can someone explain the results