Re: [R] xlsx package

2010-08-03 Thread array chip
inal Message From: array chip To: r-help@r-project.org Sent: Tue, August 3, 2010 4:41:50 PM Subject: [R] xlsx package HI, I was trying to install xlsx package for reading in Excel 2007 files. The installation went smoothly. But when I tried to load the library, I got the following error me

[R] "regression" line of 2 independent variables

2010-08-09 Thread array chip
Hi, I would like to a draw a scatterplot of x1 and x2 (plot (x1, x2)), and also want to draw a sort of "regression" line across the data points. But x1 and x2 are just 2 independent variables, so in this case a regression of x1 over x2, or vice versa, is not appropriate per se. What would be an

[R] x-axis annotation

2010-08-09 Thread array chip
Hi, I have a simple plot by plot(x,y, log='xy'). However, due to the large range of values of x, the x-axis annotation is printed as "2e+02 1e+03 5e+03 2e+04 1e+05" instead of "200 1000 5000 2 10". How can I make it printed as in the later one? Thanks John _

Re: [R] x-axis annotation

2010-08-09 Thread array chip
Thank you David! - Original Message From: David Winsemius To: array chip Cc: r-help@r-project.org Sent: Mon, August 9, 2010 12:42:06 PM Subject: Re: [R] x-axis annotation On Aug 9, 2010, at 3:14 PM, array chip wrote: > Hi, I have a simple plot by plot(x,y, log='xy').

[R] x-axis label print in 45 degree

2010-08-12 Thread array chip
Hi how can print x-axis labels in 45 degree in boxplot() (or plot in general)? I can use las=2 to print in 90 degree, but it looks ugly. Is there a simple option to do 45 degree easily? Thanks John __ R-help@r-project.org mailing list https://stat.

Re: [R] x-axis label print in 45 degree

2010-08-12 Thread array chip
Than you Marc. John - Original Message From: Marc Schwartz To: array chip Cc: r-help@r-project.org Sent: Thu, August 12, 2010 12:17:12 PM Subject: Re: [R] x-axis label print in 45 degree On Aug 12, 2010, at 2:14 PM, array chip wrote: > Hi how can print x-axis labels in 45 deg

Re: [R] x-axis label print in 45 degree

2010-08-12 Thread array chip
I searched with "print x-axis label in 45 degree" which didn't return useful links. Apparently I used poor search keywords. - Original Message From: David Winsemius To: Marc Schwartz Cc: array chip ; r-help@r-project.org Sent: Thu, August 12, 2010 12:34:16 PM Sub

[R] print numbers

2010-08-16 Thread array chip
Hi, When I plot, the axis ticks are printed as "50.00 25.00 10.00 1.00 0.05 0.01", is there any way to print them as "50 25 10 1 0.05 0.01" instead? Thanks John __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-hel

Re: [R] print numbers

2010-08-16 Thread array chip
work - plot by plot. Any other suggestions? Many thanks John - Original Message ---- From: David Winsemius To: array chip Cc: R-Help Sent: Mon, August 16, 2010 1:19:57 PM Subject: Re: [R] print numbers On Aug 16, 2010, at 3:53 PM, array chip wrote: > Hi, > > When I plot, the

[R] identical()

2010-08-16 Thread array chip
Hi, I am really puzzled by this. hope someone can help me I have a 2 small data frames "a" and "b" derived from a larger data frames. They look exactly the same to me, but identical() always returns FALSE. > a a b 2 10011048 L 4 10011048 R 6 10011049 L 8 10011049 R > b a b 1 1

Re: [R] print numbers

2010-08-16 Thread array chip
Thank you all for the suggestions. They all worked. Now, those numbers on the ticks are produced by default plot function "bxp()", i.e. they are different in each plot, is there any functions I can retrieve them so I can use formatC() or prettyNum() etc? Thanks again, John - Original Me

Re: [R] identical()

2010-08-16 Thread array chip
Oops, I overlooked the row names. Sorry for my carelessness. Thanks - Original Message From: Erik Iverson To: array chip Cc: r-h...@stat.math.ethz.ch Sent: Mon, August 16, 2010 2:53:37 PM Subject: Re: [R] identical() Hello, array chip wrote: > Hi, I am really puzzled by t

Re: [R] print numbers

2010-08-16 Thread array chip
Marc, this works perfectly! Thanks John - Original Message From: Marc Schwartz To: William Dunlap Cc: array chip ; r-help@r-project.org Sent: Mon, August 16, 2010 3:23:33 PM Subject: Re: [R] print numbers Bill et al, See ?axTicks plot(3^(0:5), 0:5, log="x",

[R] plotmath question

2010-08-19 Thread array chip
Hi all, let me give a simple example: b<-20 I would like to print ylab as "P20" where "P" is printed in Italic font. When I do the following: plot(1, ylab=expression(paste(italic("P"),b,sep=""))) I got y axis label printed as "Pb" instead of "P20". What is the best solution to print platmath s

Re: [R] plotmath question

2010-08-19 Thread array chip
Thanks, yes it worked! What about if I want to print as "P2, A" where A is just letter A and 2 is from variable b. John - Original Message From: baptiste auguie To: array chip Cc: r-h...@stat.math.ethz.ch Sent: Thu, August 19, 2010 11:08:10 AM Subject: Re: [R] plotmat

Re: [R] plotmath question

2010-08-19 Thread array chip
Thanks David! John - Original Message From: David Winsemius To: array chip Cc: baptiste auguie ; r-h...@stat.math.ethz.ch Sent: Thu, August 19, 2010 11:34:07 AM Subject: Re: [R] plotmath question On Aug 19, 2010, at 2:24 PM, array chip wrote: > Thanks, yes it worked! >

Re: [R] plotmath question

2010-08-19 Thread array chip
David, yes, I now see how it worked. Thanks again, John - Original Message From: David Winsemius To: array chip Cc: baptiste auguie ; r-h...@stat.math.ethz.ch Sent: Thu, August 19, 2010 12:12:46 PM Subject: Re: [R] plotmath question On Aug 19, 2010, at 2:46 PM, array chip wrote

[R] xyplot plot with groups

2010-08-20 Thread array chip
Hi, I am a beginner of xyplot() (or lattice package). On one hand, I immediately realized it's a very powerful utility. On the other hand, there are too many things for me to learn. Still haven't figure out a generalization of the syntax and usage under many different circumstances. Let me giv

Re: [R] xyplot plot with groups

2010-08-20 Thread array chip
What a simple way to do what I want to do! Thanks. But if there is missing data in variable "y", then the averaged lines is broken where the missing data is present. For example: dat$y[c(10,185,200,400,450)]<-NA then using type='a' option will result in broken lines. xyplot(y~day|sex, groups=tr

[R] par("usr") when used in heatmap()

2010-08-30 Thread array chip
Hi, is there anyway I can retrieve the user coordinates for the region of the heatmap (only the heatmap, not include dendrogram, x- & y- axis annotation). I found that par("usr") didn't give the user coordinates that I want. I want those user coordinates to add some additional information to th

[R] some questions about longitudinal study with baseline

2010-09-07 Thread array chip
Hi all, I asked this before the holiday, didn't get any response. So would like to resend the message, hope to get any fresh attention. Since this is not purely lme technical question, so I also cc-ed R general mailing list, hope to get some suggestions from there as well. I asked some ques

[R] logistic regression lrm() output

2011-05-18 Thread array chip
Hi, I am trying to run a simple logistic regression using lrm() to calculate a odds ratio. I found a confusing output when I use summary() on the fit object which gave some OR that is totally different from simply taking exp(coefficient), see below: > dat<-read.table("dat.txt",sep='\t',header=T

[R] sample size for survival curves

2010-05-06 Thread array chip
Dear R users, I am not asking questions specifically on R, but I know there are many statistical experts here in the R community, so here it goes my questions: Freedman (1982) propose an approximation of sample size/power calculation based on log-rank test using the formula below (This is what n

Re: [R] sample size for survival curves

2010-05-06 Thread array chip
p1=0.8 and p2=0.6 at 5 years at 5% significance level with 80% power" any comments are appreciated.   John --- On Thu, 5/6/10, Joris Meys wrote: From: Joris Meys Subject: Re: [R] sample size for survival curves To: "array chip" Date: Thursday, May 6, 2010, 8:12 PM

Re: [R] sample size for survival curves

2010-05-06 Thread array chip
Thanks Kevin. I thought the time t is at the end of follow-up (length of follow-up)? John --- On Thu, 5/6/10, Kevin E. Thorpe wrote: > From: Kevin E. Thorpe > Subject: Re: [R] sample size for survival curves > To: "array chip" > Cc: r-help@r-project.org > Date: Th

[R] automate curve drawing on nls() object

2010-05-18 Thread array chip
Hi, I would like to use the curve() function to draw the predicted curve from an nls() object. for example: dd<-read.table("dd.txt",sep='\t',header=T,row.names=1) obj<-nls(y~c+(d-c)/(1+(x/e)^b),data=dd,start=list(b=-1, c=0, d=100, e=150)) coef(obj) b c d e

Re: [R] automate curve drawing on nls() object

2010-05-18 Thread array chip
curve drawing on nls() object > To: "array chip" , r-help@r-project.org > Date: Tuesday, May 18, 2010, 7:42 PM > I can't directly answer your question > regarding 'expression', but can you just replace b, c,d, and > e with coef(obj)[1], coef(obj)[2], ... > etc. 

Re: [R] automate curve drawing on nls() object

2010-05-18 Thread array chip
010, 7:33 PM > array chip yahoo.com> writes: > > > Hi, I would like to use the curve() function to draw > the > > predicted curve from an nls() object. for example: > > > >   Is there a reason you don't want to use plot() and > predict() ??? >  

Re: [R] automate curve drawing on nls() object

2010-05-19 Thread array chip
I do know it, but wanted to spend a little more effort to make generalized function for this type of plot. Thanks --- On Tue, 5/18/10, Shi, Tao wrote: > From: Shi, Tao > Subject: Re: [R] automate curve drawing on nls() object > To: "array chip" , r-help@r-project.org >

[R] weighted regression in drc package

2010-05-21 Thread array chip
Hi, I am currently trying to do dose-response curves using weighted 4-parameter model (4PL). The weighting was based on 1/(expected variance) derived from historical data. I tried both drm() from drc package, and nls(), found very different results derived from drm() vs. nls() using "weights=" arg

[R] weighted regression using drm() in drc package

2010-05-21 Thread array chip
Hi, I am currently trying to do dose-response curves using weighted 4-parameter model (4PL). The weighting was based on 1/(expected variance) derived from historical data. I tried both drm() from drc package, and nls(), found very different results derived from drm() vs. nls() using "weights=" arg

[R] multiple pages of plot in one image file

2010-05-24 Thread array chip
Hi, is there a way to create one image file (like using win.metafile(), bmp(), etc) that contained multiple pages of plots, just like what postscript() does in creating PDF file? Thanks John __ R-help@r-project.org mailing list https://stat.ethz.ch/m

[R] studentized residues from nls()

2010-06-01 Thread array chip
Hi, I am wondering if there is a way to extract studentized residues from a nls() object? I searched archive, someone posted a similar question before (http://tolstoy.newcastle.edu.au/R/e6/help/09/04/10845.html), but didn't get an answer. Thanks for any suggestions, John _

[R] lmer() with no intercept

2010-06-03 Thread array chip
Hi, I am wondering how I can specify no intercept in a mixed model using lmer(). Here is an example dataset attached ("test.txt"). There are 3 workers, in 5 days, measured a response variable "y" on independent variable "x". I want to use a quadratic term (x2 in the dataset) to model the relat

[R] fixed intercept

2010-06-04 Thread array chip
Hi, is it possible to specify a constant intercept (based on prior knowledge) in linear regression using lm()? Thanks John __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-

[R] lmer() with no intercept

2010-06-11 Thread array chip
Hi, I asked this before, but haven't got any response. So would like to have another try. thanks for help. Also tried twice to join the model mailing list so that I can ask question there, but still haven't got permission to join that list yet. === Hi, I am wondering how I can spec

[R] comparing proportions

2011-02-09 Thread array chip
Hi, I have a dataset that has 2 groups of samples. For each sample, then response measured is the number of success (no.success) obatined with the number of trials (no.trials). So a porportion of success (prpop.success) can be computed as no.success/no.trials. Now the objective is to test if th

Re: [R] comparing proportions

2011-02-09 Thread array chip
Hi Bert, Thanks for your reply. If I understand correctly, prop.test() is not suitable to my situation. The input to prop.test() is 2 numbers for each group (# of success and # of trials, for example, groups 1 has 5 success out of 10 trials; group 2 has 3 success out of 7 trials; etc. prop.te

[R] comparing groups of proportions

2011-02-10 Thread array chip
Hi, I initially posted this to the general R mailing list, but Bert Gunter thought this may be a mixed model issue, so suggested me to post here. I have a dataset that has 2 groups of subjects. For each subject in each group, the response measured is the number of success (no.success) obatined w

Re: [R] comparing proportions

2011-02-10 Thread array chip
e 0.15 to 0.85, so maybe regular linear model may not be appropriate?   Thank you,   John     ________ From: Robert A LaBudde To: array chip Cc: Bert Gunter ; r-h...@stat.math.ethz.ch Sent: Thu, February 10, 2011 12:54:44 PM Subject: Re: [R] comparing proportions 1.

[R] nested case-control study

2011-02-26 Thread array chip
Hi, I am wondering if there is a package for doing conditional logistic regression for nested case-control study as described in "Estimation of absolute risk from nested case-control data" by Langholz and Borgan (1997) where Horvitz-Thompson sampling weight (log of (number in the risk set divid

Re: [R] nested case-control study

2011-02-27 Thread array chip
Thomas, thank you for pointing this out! On another note, do you think coxph() will also take offset(logweight) as part of the formula? Or just use the argument weight=logweight in coxph()? Thanks! John From: Thomas Lumley Sent: Sun, February 27, 2011 12:1

Re: [R] nested case-control study

2011-02-28 Thread array chip
Terry, thanks very much! Professor Langholz used a SAS software trick to estimate absolute risk by creating a fake variable "entry_time" that is 0.001 less than the variable "exit_time" (i.e. time to event), and then use both variables in Phreg. Is this equivalent to your creating a dummy surv

[R] glht() used with coxph()

2011-03-01 Thread array chip
Hi, I am experimenting with using glht() from multcomp package together with coxph(), and glad to find that glht() can work on coph object, for example: > (fit<-coxph(Surv(stop, status>0)~treatment,bladder1)) coxph(formula = Surv(stop, status > 0) ~ treatment, data = bladder1)

Re: [R] glht() used with coxph()

2011-03-01 Thread array chip
In case anyone is interested, I figure it out that when strata is used, I have to specify the comparison matrix manually: > (fit<-coxph(Surv(stop, status>0)~treatment+strata(enum),bladder1)) > coef(fit) treatmentpyridoxine treatmentthiotepa 0.1877925 -0.2097894 > glht(fit,li

[R] read.ssd() from foreign package

2011-03-06 Thread array chip
Hi, I am encountering a confusing problem when I tried to use read.ssd to read SAS datasets. For one SAS dataset "a.sas7bdat", it did not work; while for another SAS dataset "b.sas7bdat" it worked: > tmp<-read.ssd("C:\\SASdata", "a",sascmd="C:/Program >Files/SAS/SASFoundation/9.2/sas.exe") SAS

Re: [R] read.ssd() from foreign package

2011-03-07 Thread array chip
2.40 seconds cpu time0.59 seconds Thank you! John ________ From: peter dalgaard Cc: r-help@r-project.org Sent: Sun, March 6, 2011 1:51:51 AM Subject: Re: [R] read.ssd() from foreign package On Mar 6, 2011, at 09:34 , array chip wrote: >

[R] survest() for cph() in Design package

2011-03-07 Thread array chip
Hi, I am trying to run a conditional logistic model on a nested case-control study using cph() and then estimate survival based on the model. The data came from Prof Bryan Langholz website where he also has the SAS code to this, so I am trying to replicate the SAS results. The data attached. B

[R] ok to use glht() when interaction is NOT significant?

2011-03-07 Thread array chip
Hi, let's say I have a simple ANOVA model with 2 factors A (level A1 and A2) and B (level B1 and B2) and their interaction: aov(y~A*B, data=dat) It turns out that the interaction term is not significant (e.g. P value = 0.2), but if I used glht() to compare A1 vs. A2 within each level of B, I f

Re: [R] ok to use glht() when interaction is NOT significant?

2011-03-07 Thread array chip
Hi Bert, thank you for your thoughtful and humorous comments, :-) It is scientifically meaningful to do those comparisons, and the results of these comparisons actually make sense to our hypothesis, i.e. one is significant at B2 level while the other is not at B1 level. Just unfortunately, the

Re: [R] ok to use glht() when interaction is NOT significant?

2011-03-08 Thread array chip
e. If you have a priori interest in the comparison of A1 vs. A2 at B2, then you can test it as a pre-planned contrast and not worry too much about "protection" or multiplicity. HTH, Andy > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-bou

[R] ideas on sorting

2011-03-14 Thread array chip
Hi, I have a character vector as below: a<-c('10','3R','4','4R','5','5R','6','6R','7','8','9','7R','1','10R','11' ,'11R','12','12R','13','13R','14','14R','15','15R','1R','2','2R','3','8R' ,'9R') Is there a clever way to sort this easily to return a vector of index that would produce a vector as

Re: [R] ideas on sorting

2011-03-14 Thread array chip
That's a smart way to do this. Thanks! John From: Berend Hasselman To: r-help@r-project.org Sent: Mon, March 14, 2011 10:49:37 AM Subject: Re: [R] ideas on sorting array chip wrote: > > Hi, I have a character vector as below: > > a<

Re: [R] ideas on sorting

2011-03-14 Thread array chip
Thank you Bill. John From: William Dunlap Sent: Mon, March 14, 2011 10:47:39 AM Subject: RE: [R] ideas on sorting > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of array ch

Re: [R] ideas on sorting

2011-03-14 Thread array chip
Thanks Martin! From: Martin Morgan Cc: r-help@r-project.org Sent: Mon, March 14, 2011 12:33:40 PM Subject: Re: [R] ideas on sorting On 03/14/2011 10:32 AM, array chip wrote: > Hi, I have a character vector as below: > > a<-c('10',&#x

[R] hclust() memory issue

2011-03-14 Thread array chip
Hi, I have a microarray dataset of dimension 25000x30 and try to clustering using hclust(). But the clustering on the rows failed due to the size: > y<-hclust(dist(data),method='average') Error: cannot allocate vector of size 1.9 Gb I tried to increase the memory using memory.limit(size=3000), s

Re: [R] hclust() memory issue

2011-03-14 Thread array chip
, TX 77030 Voice: (713) 798-6227 Fax: (713) 790-1275 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of array chip Sent: Monday, March 14, 2011 4:03 PM To: r-help@r-project.org Subject: [R] hclust() memory issue Hi, I have a microarray

[R] regular expression

2011-03-31 Thread array chip
Hi, I am stuck on this: how to specify a match pattern that means not to include "abc"? I tried: grep("^(abc)", "hello", value=T) should return "hello". while grep("^(abc)", "hello abcd foo", value=T) should return character(0). But both returned character(0). Thanks John [[alte

Re: [R] regular expression

2011-03-31 Thread array chip
) character(0) I think both examples should return the text, but the 2nd example didn't. What was wrong here? Thanks John From: Bernd Weiss Sent: Thu, March 31, 2011 5:32:25 PM Subject: Re: [R] regular expression Am 31.03.2011 19:31, schrieb array chip: &

Re: [R] regular expression

2011-03-31 Thread array chip
Ok then this code didn't do what I wanted. I want "not including 'arg' before '.symptom'", not individual letters of "arg", but rather as a word. Bill Dunlap suggested using invert=T, it works for single 1 condition, but not for 2 conditions here: not including "arg" before ".", but at the same

Re: [R] regular expression

2011-04-01 Thread array chip
Great. thank you Bernd! Learned a new thing here. John From: Bernd Weiss Cc: r-help@r-project.org Sent: Thu, March 31, 2011 6:19:25 PM Subject: Re: [R] regular expression Am 31.03.2011 21:06, schrieb array chip: > Ok then this code didn't do what

[R] function in argument

2011-04-01 Thread array chip
Hi, I tried to pass the function dist() as an argument, but got an error message. However, almost the same code with mean() as the function to be passed, it works ok. foo<-function (x, xfun = dist) { xfun(x) } foo(matrix(1:100,nrow=5)) Error in foo(matrix(1:100, nrow = 5)) : could not fi

Re: [R] function in argument

2011-04-01 Thread array chip
OK, I figured it out, need to add stats::: before dist foo<-function (x, xfun = stats:::dist) { xfun(x) } John To: r-help@r-project.org Sent: Fri, April 1, 2011 2:56:06 PM Subject: [R] function in argument Hi, I tried to pass the function dist() as an ar

[R] classification

2011-04-07 Thread array chip
Dear all, this is not a pure R question, but really about how to set up a multinomial logistic regression model to do a multi-class classification. I would really appreciate if any of you would give me some of your thoughts and recommendation. Let's say we have 3-class classification problem: A

[R] RExcel

2011-04-11 Thread array chip
Hi, I am installing Excel using package "RExcelInstaller". When I tried to run installRExcel() I got this error message: You don not have the R package rcom installed. The (D)COM server installed which will aloow you to use the background server in RExcel. Since rcom is not installed, foregro

Re: [R] RExcel

2011-04-11 Thread array chip
s the room, the thing itself have purpose? Or do we, what's the word... imbue it." - Jubal Early, Firefly r-help-boun...@r-project.org wrote on 04/11/2011 02:08:02 PM: > [image removed] > > [R] RExcel > > array chip > > to: > > r-help > > 04

[R] time dependent hazard ratios

2011-04-17 Thread array chip
Hi, I am new to time-dependent Cox model to estimate time dependent hazard ratios. Let me use aml dataset from survival package: > aml3<-survSplit(aml2,cut=c(5,10,20),end="time",start="start", event="status",episode="i") If I want to esimate hazard ratio for each of the time intervals 0-5,

[R] time dependent hazard ratios

2011-04-18 Thread array chip
Sorry this is a re-post. I posted it last night, haven't heard from anyone, hope this moves the thread up a little and anyone can comment? Thanks! John - Forwarded Message From: array chip To: r-help@r-project.org Sent: Sun, April 17, 2011 11:33:32 PM Subject: time depe

Re: [R] time dependent hazard ratios

2011-04-18 Thread array chip
18, 2011, at 4:09 PM, array chip wrote: > Sorry this is a re-post. I posted it last night, haven't heard from anyone, >hope > this moves the thread up a little and anyone can comment? My observation is that coefficients of 19 in Cox (or other exponential models) models gene

[R] survival probability estimate method

2011-08-04 Thread array chip
Hi, I was reading a paper published in JCO "Prediction of risk of distant recurrence using 21-gene recurrence score in node-negative and node-positive postmenopausal patients with breast cancer treated with anastrozole or tamoxifen: a TransATAC study" (ICO 2010 28: 1829). The author uses a metho

Re: [R] survival probability estimate method

2011-08-04 Thread array chip
some hints how to do this in R.   Thanks   John   - Original Message - From: array chip To: r-help Cc: Sent: Thursday, August 4, 2011 11:44 AM Subject: [R] survival probability estimate method Hi, I was reading a paper published in JCO "Prediction of risk of distant recurrence usi

Re: [R] survival probability estimate method

2011-08-04 Thread array chip
Dear Peter, Thanks very much for the references. It seems the method is based on parametric proportional hazard models by incorporating cubic spline of the baseline hazards, not sure if tweaking survreg() would do? Best, John - Original Message - From: Peter Jepsen To: 'array

[R] a question

2011-08-05 Thread array chip
Hi, I read on a paper the below statement, don't know how that was calculated. Basically, there are 2 continuous variables x1 and x2, as independent variable for predicting cancer recurrence. So this is a survival analysis. Now the author try to check the correlation between x1 and x2. He calcul

Re: [R] a question

2011-08-05 Thread array chip
Nice guess Duncan! Otherwise, I can't think of other ways to get that number. Thanks John - Original Message - From: Duncan Murdoch To: array chip Cc: r-help Sent: Friday, August 5, 2011 11:21 AM Subject: Re: [R] a question On 05/08/2011 2:19 PM, array chip wrote: > Hi, I

[R] mixed model fitting between R and SAS

2011-08-07 Thread array chip
Hi al, I have a dataset (see attached), which basically involves 4 treatments for a chemotherapy drug. Samples were taken from 2 biopsy locations, and biopsy were taken at 2 time points. So each subject has 4 data points (from 2 biopsy locations and 2 time points). The objective is to study tre

Re: [R] mixed model fitting between R and SAS

2011-08-08 Thread array chip
+ time * trt, random=list(pid=pdIdent(~0  + biopsy.site)), data = test,  correlation=corAR1()) But they are not the same. What did I misunderstand here? Many thanks John - Original Message - From: "ONKELINX, Thierry" To: array chip ; "r-sig-mixed-mod...@r-project.o

[R] calibration curve for cph()

2011-08-15 Thread array chip
Hi, the calibrate.cph() function in rms package generate calibration curve for Cox model on the same dataset where the model was derived using bootstrapping or cross-validation. If I have the model built on dataset 1, and now I want to produce a calibration curve for this model on an independent

Re: [R] calibration curve for cph()

2011-08-15 Thread array chip
is there a R function that produces calibration curve on an independetn data automatically, just like what calibrate() does on the training data itself? Thanks John From: Comcast Cc: "r-help@r-project.org" Sent: Monday, August 15, 2011 2:04 PM Subject: Re:

Re: [R] calibration curve for cph()

2011-08-16 Thread array chip
; A combination of Predict (your newdata), cut2, and the plotting function > of your choice ought to suffice. But thought that cross-validation was an > option. Not at console at the moment (just off airplane.) > > Sent from my iPhone > > On Aug 15, 2011, at 5:26 PM, array chip &

Re: [R] calibration curve for cph()

2011-08-16 Thread array chip
Oops, thank for reminding. I found that an in-house package interfered with rms package, which caused the error. Thanks David! John - Original Message - From: David Winsemius To: array chip Cc: Frank Harrell ; "r-help@r-project.org" Sent: Tuesday, August 16, 201

[R] cuminc() in cmprsk package for cumulative incidence

2011-08-16 Thread array chip
Hi, To use cuminc() from cmprsk package, if a subject has 2 events (both the event of interest and the event of competing risk), should I create 2 observations for this subject in the dataset, one for each event with different fstatus (1 and 2), or just 1 observation with whatever event that

Re: [R] Labelling all variables at once (using Hmisc label)

2011-08-17 Thread array chip
Hi Frank, it's true to one of your reply to my previous post, can only be seen in Nabble. - Original Message - From: David Winsemius To: Frank Harrell Cc: r-help@r-project.org Sent: Wednesday, August 17, 2011 3:08 PM Subject: Re: [R] Labelling all variables at once (using Hmisc label)

[R] survplot() for cph(): Design vs rms

2011-08-25 Thread array chip
Hi, in Design package, a plot of survival probability vs. a covariate can be generated by survplot() on a cph object using the folliowing code: n <- 1000 set.seed(731) age <- 50 + 12*rnorm(n) label(age) <- "Age" sex <- factor(sample(c('male','female'), n, TRUE)) cens <- 15*runif(n) h <- .02*exp(.

Re: [R] survplot() for cph(): Design vs rms

2011-08-25 Thread array chip
Thank you David. The plot from Design package will draw a plot of survival probability at 5 years (in my example) versus different age. I will look into Predict() in rms package to see how this can be done. John - Original Message - From: David Winsemius To: array chip Cc: &q

Re: [R] survplot() for cph(): Design vs rms

2011-08-25 Thread array chip
Thanks Frank! - Original Message - From: Frank Harrell To: r-help@r-project.org Cc: Sent: Thursday, August 25, 2011 4:33 PM Subject: Re: [R] survplot() for cph(): Design vs rms http://biostat.mc.vanderbilt.edu/Rrms shows differences between Design and rms Frank array chip wrote

[R] baseline cumulative hazard by basehaz()

2011-08-26 Thread array chip
Hi, basehaz() in survival package is said to estimate the baseline cumulative hazard from coxph(), but it actually calculate cumulative hazard by -log(survfit(coxph.object)). But survfit() calculate survival based on MEAN covariate value, not covariate value of 0. I thought baseline cumulativ

[R] weird apply() behavior

2011-08-29 Thread array chip
Hi, I had a weird results from using apply(). Here is an simple example: > y<-data.frame(list(a=c(1,NA),b=c('2k','0'))) > y     a b 1  1   2k 2 NA   0 > apply(y,1,function(x){x<-unlist(x); if (!is.na(x[2]) & x[2]=='2k' & > !is.na(x[1]) & x[1]=='1') 1 else 0} ) This should print "1 0" as ou

Re: [R] weird apply() behavior

2011-08-29 Thread array chip
Thanks Bill and David! John - Original Message - From: William Dunlap To: array chip ; "r-help@r-project.org" Cc: Sent: Monday, August 29, 2011 5:21 PM Subject: RE: [R] weird apply() behavior apply() should come with a big warning that it was written for matrices and c

[R] suggestion for proportions

2011-09-07 Thread array chip
Hi, I am wondering if anyone can suggest how to test the equality of 2 proportions. The caveat here is that the 2 proportions were calculated from the same number of samples using 2 different tests. So essentially we are comparing 2 accuracy rates from same, say 100, samples. I think this is lik

Re: [R] suggestion for proportions

2011-09-07 Thread array chip
Hi all, thanks very much for sharing your thoughts. and sorry for my describing the problem not clearly, my fault. My data is paired, that is 2 different diagnostic tests were performed on the same individuals. Each individual will have a test results from each of the 2 tests. Then in the end,

Re: [R] suggestion for proportions

2011-09-09 Thread array chip
between the 2 tests. Thanks again. John - Original Message - From: Viechtbauer Wolfgang (STAT) To: "r-help@r-project.org" Cc: csrabak ; array chip Sent: Thursday, September 8, 2011 1:24 AM Subject: RE: [R] suggestion for proportions I assume you mean Cohen's kappa. T

[R] closed testing procedure

2011-09-10 Thread array chip
Hi, are the methods for multiple testing p value adjustment (Shaffer, Westfall, free) implemented in the function adjusted() in multcomp package so called closed testing procedure? what about those methods (holm, hochberg, hommel, BH, BY) implemented in the p.adjust() in the stats package?   Tha

[R] AUC calculated from Epi package

2011-06-20 Thread array chip
Hi, I have a dataset (see attached) with 2 variables "Y" is binary, "x" is a continuous variable. I want to calculate area under the curve (AUC) for the ROC curve, but I got different AUC values using ROC() from Epi package vs. rcorr.cens() from rms package: test<-read.table("test.txt",sep='\t'

[R] cumulative incidence plot vs survival plot

2011-06-27 Thread array chip
Hi, I am wondering if anyone can explain to me if cumulative incidence (CI) is just "1 minus kaplan-Meier survival"? Under what circumstance, you should use cumulative incidence vs KM survival? If the relationship is just CI = 1-survival, then what difference it makes to use one vs. the other?

Re: [R] cumulative incidence plot vs survival plot

2011-06-27 Thread array chip
t.org Sent: Mon, June 27, 2011 1:45:35 PM Subject: Re: [R] cumulative incidence plot vs survival plot On Jun 27, 2011, at 4:31 PM, array chip wrote: > Hi, I am wondering if anyone can explain to me if cumulative incidence (CI) is > just "1 minus kaplan-Meier survival"? First tell us

Re: [R] cumulative incidence plot vs survival plot

2011-06-27 Thread array chip
Thank you David. Didn't realized someone posted related topic this morning. John - Original Message From: David Winsemius To: array chip Cc: r-help@r-project.org Sent: Mon, June 27, 2011 3:38:36 PM Subject: Re: [R] cumulative incidence plot vs survival plot On Jun 27, 2011,

Re: [R] cumulative incidence plot vs survival plot

2011-06-28 Thread array chip
chell) To: array chip ; David Winsemius Cc: r-help@r-project.org Sent: Tue, June 28, 2011 9:20:22 AM Subject: RE: [R] cumulative incidence plot vs survival plot John, Since death precludes recurrence, censoring deaths would violate the KM estimator assumption that additional follow-up would event

[R] how to print "<=" in plot title

2011-06-28 Thread array chip
Hi, how can I print "<=" (I mean the symbol of just one character) in the main title of a plot? for example: plot(1:10, main=paste("x <=", x)) where variable x is some number generated on the fly. Thanks John __ R-help@r-project.org mailing list ht

Re: [R] cumulative incidence plot vs survival plot

2011-06-28 Thread array chip
this patient? I think I still code this patient as 0 (censoring) because lost-of-followup occurred before death, am I correct? Thanks very much! John - Original Message ---- From: alanm (Alan Mitchell) To: array chip ; David Winsemius Cc: r-help@r-project.org Sent: Tue, June 28, 2011 9:2

Re: [R] how to print "<=" in plot title

2011-06-28 Thread array chip
] cluster_1.13.3 grid_2.12.2 lattice_0.19-17 tools_2.12.2 - Original Message From: Bert Gunter To: array chip Cc: R Sent: Tue, June 28, 2011 10:32:29 AM Subject: Re: [R] how to print "<=" in plot title This is highly system dependent: what "character" d

<    1   2   3   >