Re: [R] linear mixed model using lmer

2022-03-04 Thread array chip via R-help
4:41:57 PM PST, array chip via R-help wrote: >Dear all, I have this simple dataset to measure the yeild of a crop collected >in 2 batches (attached). when I ran a simple inear mixed model using lmer to >estimate within-batch and between-batch variability, the between-batch >variabil

Re: [R] 2 KM curves on the same plot

2020-09-30 Thread array chip via R-help
ll against which I have been banging my head a break. Jim On Wed, Sep 30, 2020 at 1:57 PM array chip wrote: > > Jim, > > I tried a few things, I found that clip() works if I just do some regular > graphing tasks. But as long as I run lines(fit) with "fit" object is

Re: [R] 2 KM curves on the same plot

2020-09-30 Thread array chip via R-help
nes" method that resets the clipping region out of sight. Fortunately Mark Schwartz provided a way to get your plot so I will give the wall against which I have been banging my head a break. Jim On Wed, Sep 30, 2020 at 1:57 PM array chip wrote: > > Jim, > > I tried a few things

Re: [R] 2 KM curves on the same plot

2020-09-29 Thread array chip via R-help
hics command. Try: points(-1,-1) before calling lines() Jim On Wed, Sep 30, 2020 at 12:26 PM array chip wrote: > > Hi Jim, > > I tried the clip() function below, surprisingly it did not work! I read the R > help file and feel your script should work. To have a workable exampl

Re: [R] 2 KM curves on the same plot

2020-09-29 Thread array chip via R-help
perate until you have issued a graphics command. Try: points(-1,-1) before calling lines() Jim On Wed, Sep 30, 2020 at 12:26 PM array chip wrote: > > Hi Jim, > > I tried the clip() function below, surprisingly it did not work! I read the R > help file and feel your script should w

Re: [R] 2 KM curves on the same plot

2020-09-29 Thread array chip via R-help
direct way would be: plot(fit1, col=1:2) xylim<-par("usr") clip(4,xylim[2],xylim[3],xylim[4]) lines(fit2,col=1:2) Remember that the new clipping rectangle will persist until you or something else resets it. Jim On Tue, Sep 29, 2020 at 10:34 AM array chip via R-help wrote: > &g

Re: [R] 2 KM curves on the same plot

2020-09-29 Thread array chip via R-help
0, 1, 0.2), labels = FALSE, lty = "dashed") Regards, Marc Schwartz > On Sep 28, 2020, at 8:33 PM, array chip via R-help > wrote: > > Hello, > > Can anyone suggest a simple way to generate a Kaplan-Meier plot with 2 > survfit objects, just like this one: > &

Re: [R] 2 KM curves on the same plot

2020-09-29 Thread array chip via R-help
new clipping rectangle will persist until you or something else resets it. Jim On Tue, Sep 29, 2020 at 10:34 AM array chip via R-help wrote: > > Hello, > > Can anyone suggest a simple way to generate a Kaplan-Meier plot with 2 > survfit objects, just like this one: > &g

[R] 2 KM curves on the same plot

2020-09-28 Thread array chip via R-help
Hello, Can anyone suggest a simple way to generate a Kaplan-Meier plot with 2 survfit objects, just like this one:  https://drive.google.com/file/d/1fEcpdIdE2xYtA6LBQN9ck3JkL6-goabX/view?usp=sharing Suppose I have 2 survfit objects: fit1 is for the curve on the left (survtime has been truncate

Re: [R] [External] R rounding problem?

2020-09-03 Thread array chip via R-help
Thanks Richard. Got it now... On Thursday, September 3, 2020, 10:12:36 PM PDT, Richard M. Heiberger wrote: FAQ 7.31 On Fri, Sep 4, 2020 at 12:47 AM array chip via R-help wrote: > > Hello, > > I made a mistake today on simple counting in R, that almost got me into > troubl

[R] R rounding problem?

2020-09-03 Thread array chip via R-help
Hello, I made a mistake today on simple counting in R, that almost got me into trouble. After trying multiple times, I finally figured out it's rounding issue in R. For exmaple, when I just simply type: > (6.9-6.3) > 0.6 [1] TRUE 6.9-6.3 should be 0.6 exactly, but R thinks that it's greater t

[R] how to generate this kind of graph

2020-07-22 Thread array chip via R-help
Hello everyone, I saw this scatterplots from a paper and thought it looked very nice: https://drive.google.com/file/d/1V7F1gq-J_GIFDOrJs00hwGyXUqCZ_xwa/view?usp=sharing It was similar to stripchart() with 'jitter' method, but it has a special pattern of aligning points which made it look nice

[R] How to generate this type of scatter plots in R

2020-07-22 Thread array chip via R-help
Hello everyone, I saw this scatterplots from a paper and thought it looked very nice: https://drive.google.com/file/d/1V7F1gq-J_GIFDOrJs00hwGyXUqCZ_xwa/view?usp=sharing It was similar to stripchart() with 'jitter' method, but it has a special pattern of aligning points which made it look nice

Re: [R] R 4.0.2 is released

2020-06-23 Thread array chip via R-help
PDT, array chip via R-help wrote: Hi, I downloaded R4.0.2 and installed it succesffully without any error. However, when I opened up a R session (using x64) and tried to install packages, I got the following error message: > utils:::menuInstallPkgs() Warning: failed to download mirrors f

Re: [R] R 4.0.2 is released

2020-06-23 Thread array chip via R-help
Hi, I downloaded R4.0.2 and installed it succesffully without any error. However, when I opened up a R session (using x64) and tried to install packages, I got the following error message: > utils:::menuInstallPkgs() Warning: failed to download mirrors file (internet routines cannot be loaded);

Re: [R] weighed Fleming-Harrington log rank test

2018-02-16 Thread array chip via R-help
Thank you Terry. Right now I can use comp() from survMisc package to do the 2-parameter version of F-H weighting. I think both SAS and stata offer the 2-parameter version, so just thought it would be nice if survdiff() can have that option given it's standard package in R.  Thanks! John On

Re: [R] Fleming-Harrington weighted log rank test

2018-02-15 Thread array chip via R-help
Thank you David! On Wednesday, February 14, 2018, 6:05:46 PM PST, David Winsemius wrote: > On Feb 14, 2018, at 5:26 PM, David Winsemius wrote: > >> >> On Feb 13, 2018, at 4:02 PM, array chip via R-help >> wrote: >> >> Hi all, >> >

[R] Fleming-Harrington weighted log rank test

2018-02-13 Thread array chip via R-help
Hi all,  The survdiff() from survival package has an argument "rho" that implements Fleming-Harrington weighted long rank test.  But according to several sources including "survminer" package (https://cran.r-project.org/web/packages/survminer/vignettes/Specifiying_weights_in_log-rank_comparison

[R] SAMseq errors

2017-11-29 Thread array chip via R-help
Sorry forgot to use plain text format, hope this time it works: Hi, I am trying to using SAMseq() to analyze my RNA-seq experiment (2 genes x 550 samples) with survival endpoint. It quickly give the following error: > library(samr) Loading required package: impute Loading required package: m

[R] SAMseq errors

2017-11-29 Thread array chip via R-help
Hi, I am trying to using SAMseq() to analyze my RNA-seq experiment (2 genes x 550 samples) with survival endpoint. It quickly give the following error: > library(samr)Loading required package: imputeLoading required package: > matrixStats Attaching package: ‘matrixStats’ The following objects

Re: [R] gsDesign Pocock & OBF boundary

2017-09-24 Thread array chip via R-help
] https://cran.r-project.org/web/packages/reprex/index.html (read the vignette) -- Sent from my phone. Please excuse my brevity. On September 23, 2017 9:53:05 PM PDT, array chip via R-help wrote: >Sorry for messed up text. Here it goes again: >I am learning to use the gsDesign package. &

Re: [R] gsDesign Pocock & OBF boundary

2017-09-23 Thread array chip via R-help
her the above analysis is still valid? Or for unequal spacing, I have to use Lan-Demet’s error spending function approximations? Thank you, From: Berend Hasselman To: array chip Cc: R-help Mailing List Sent: Friday, September 22, 2017 11:46 PM Subject: Re: [R] gsDesign Pocock & OBF b

[R] gsDesign Pocock & OBF boundary

2017-09-22 Thread array chip via R-help
Hi, I am learning to use your gsDesign package! I have a question about Pocock and OBF boundary. As far as Iunderstand, these 2 boundaries require equal spacing between interim analyses(maybe this is not correct?). But I can still use gsDesign to run an analysisbased on unequal spacing:  gsDes

[R] deviance in GLM vs. summary.glm

2017-05-30 Thread array chip via R-help
Hi, I am running a logistic regression on a simple dataset (attached) using glm: > dat<-read.table("dat.txt",sep='\t',header=T) If I use summary() on a logistic model: > summary(glm(y~x1*x2,dat,family='binomial')) Coefficients:            Estimate Std. Error z value Pr(>|z|)(Intercept)     19.57  

Re: [R] Lattice xyplot

2017-05-01 Thread array chip via R-help
Thanks all for the clarification! From: Jeff Newmiller To: r-help@r-project.org; Bert Gunter ; array chip Cc: "r-help@r-project.org" Sent: Monday, May 1, 2017 10:53 AM Subject: Re: [R] Lattice xyplot It is not a question of whether lattice "understands&quo

[R] Lattice xyplot

2017-05-01 Thread array chip via R-help
Dear all, I am new to lattice, so would appreciate anyone's help on the questions below. I am using xyplot to plot some trend in my dataset. Using the example dataset attached, I am trying to plot variable "y" over variable "time" for each subject "id": dat<-read.table("dat.txt",sep='\t',header=

Re: [R] standard error of survfit.coxph()

2014-07-21 Thread array chip
Dear Terry/All, I was trying to use your explanation of the standard error estimate from survfit.coxph() to verify the standard error estimates for the method of log(log(S)), but couldn't get the estimates correct. Here is an example using the lung dataset: > fit<-coxph(Surv(time,status)~wt.

Re: [R] standard error of survfit.coxph()

2014-07-21 Thread array chip
Terry, I figured out that variance of log(-log(S)) should be (1/H^2)var(H), not (1/S^2)var(H)! Thanks John e...@mayo.edu>; "r-help@r-project.org" Sent: Monday, July 21, 2014 11:41 AM Subject: Re: standard error of survfit.coxph() Dear Terry, I was try

Re: [R] standard error of survfit.coxph()

2014-07-21 Thread array chip
Dear Terry, I was trying to use your explanation of the standard error estimate from survfit.coxph() to verify the standard error estimates for the method of log(log(S)), but couldn't get the estimates correct. Here is an example using the lung dataset: > fit<-coxph(Surv(time,status)~wt.loss,l

Re: [R] standard error of survfit.coxph()

2014-06-30 Thread array chip
Thank you Terry for the explanation! John From: "Therneau, Terry M., Ph.D." Sent: Monday, June 30, 2014 6:04 AM Subject: Re: standard error of survfit.coxph() 1. The computations "behind the scenes" produce the variance of the cumulative hazard. This is

[R] standard error of survfit.coxph()

2014-06-27 Thread array chip
Hi, can anyone help me to understand the standard errors printed in the output of survfit.coxph()? time<-sample(1:15,100,replace=T) status<-as.numeric(runif(100,0,1)<0.2) x<-rnorm(100,10,2) fit<-coxph(Surv(time,status)~x)     ### method 1 survfit(fit, newdata=data.frame(time=time,status=status

Re: [R] prediction based on conditional logistic regression clogit

2014-06-16 Thread array chip
Thank you Peter. Any other suggestions are absolutely welcome!! John From: peter dalgaard Cc: "r-help@r-project.org" Sent: Monday, June 16, 2014 2:22 AM Subject: Re: [R] prediction based on conditional logistic regression clogit > Hi, I am using clogit

[R] prediction based on conditional logistic regression clogit

2014-06-15 Thread array chip
Hi, I am using clogit() from survival package to do conditional logistic regression. I also need to make prediction on an independent dataset to calculate predicted probability. Here is an example: > dat <- data.frame(set=rep(1:50,each=3), status=rep(c(1,0,0),50), > x1=rnorm(150,5,1), x2=rnorm

[R] survival estimates for covariate values

2014-05-15 Thread array chip
Hi all, let's say we can fit a Cox model with a numeric variable "x" as the independent variable. The we can calculate, say 10-year survival, for any given value of "x" (0 to 10 in increment of 0.1 in the example below): > fit <- coxph(Surv(time, event)~x,dat) > surv10yr<- summary(survfit(fit,n

[R] survival estimates for covariate values

2014-05-14 Thread array chip
Hi all, let's say we can fit a Cox model with a numeric variable "x" as the independent variable. The we can calculate, say 10-year survival, for any given value of "x" (0 to 10 in increment of 0.1 in the example below): > fit <- coxph(Surv(time, event)~x,dat) > surv10yr<- summary(survfit(fit,ne

Re: [R] median survival

2014-01-28 Thread array chip
please ignore. actually the median survival from survfit() is the mean of the 2 time points. To: R help Sent: Tuesday, January 28, 2014 11:27 AM Subject: [R] median survival Hi, if 50% survival probability horizontal line in a Kaplan-Meier survival curve

Re: [R] unique rows

2014-01-28 Thread array chip
sorry.. don't know unique().. such a great function From: Bert Gunter Cc: "r-help@r-project.org" Sent: Tuesday, January 28, 2014 2:21 PM Subject: Re: [R] unique rows Inline. -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data i

[R] unique rows

2014-01-28 Thread array chip
Hi, I wanted to remove redundant rows (with same entry in columns) in a data frame. For example, with this data frame: > dat<-cbind(x=c('a','a','b','b','c','c'),y=c('x','x','d','s','g','g')) > dat x   y  [1,] "a" "x" [2,] "a" "x" [3,] "b" "d" [4,] "b" "s" [5,] "c" "g" [6,] "c" "g" after re

[R] median survival

2014-01-28 Thread array chip
Hi, if 50% survival probability horizontal line in a Kaplan-Meier survival curve overlap one of the step line between 2 time points t1 and t2, the survfit() from survival package estimates median survival as t2 (the longest time point). But I saw some articles (page 23: http://www.amstat.org/ch

Re: [R] Different colours for LatticeExtra graphs

2014-01-08 Thread array chip
http://overview.mail.yahoo.com?.src=iOS";>Sent from Yahoo Mail for iPhone [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-projec

Re: [R] Different colours for LatticeExtra graphs

2014-01-08 Thread array chip
http://overview.mail.yahoo.com?.src=iOS";>Sent from Yahoo Mail for iPhone [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-projec

[R] Installation folder

2014-01-08 Thread array chip
Hi, I noticed that when I install/update packages, the installation folder is C:/User/My Document/R, not in C:/Program Files/R. R itself was still in Program Files folder. Don't know how this has happened. It used to work ok.Any clues or how to correct the problem is appreciated!ThanksJohnhttp:

[R] estimating survival function from Cox model

2013-12-17 Thread array chip
Hi, I have some questions on how to estimate the survival function from a Cox model. I know how to do this in R using survfit(). But let's say the model was done is another software, and I was only given the estimate of baseline cumulative hazard "A0(t=10)" at the specified time "t=10" (basel

[R] estimating survival function from Cox model

2013-12-17 Thread array chip
Hi, I have some questions on how to estimate the survival function from a Cox model. I know how to do this in R using survfit(). But let's say the model was done is another software, and I was only given the estimate of baseline cumulative hazard "A0(t=10)" at the specified time "t=10" (basel

[R] estimating survival function from Cox model

2013-12-17 Thread array chip
Hi, I have some questions on how to estimate the survival function from a Cox model. I know how to do this in R using survfit(). But let's say the model was done is another software, and I was only given the estimate of baseline cumulative hazard "A0(t=10)" at the specified time "t=10" (basel

Re: [R] power analysis is applicable or not

2013-11-12 Thread array chip
ate Medical University Binghamton, NY array chip wrote: > Hi, this is a statistical question rather than a pure R question. I have got > many help from R mailing list in the past, so would like to try here and > appreciate any input: > > I conducted Mantel-Haenszel test to show

[R] power analysis is applicable or not

2013-11-12 Thread array chip
Hi, this is a statistical question rather than a pure R question. I have got many help from R mailing list in the past, so would like to try here and appreciate any input: I conducted Mantel-Haenszel test to show that the performance of a diagnostic test did not show heterogeneity among 4 study

Re: [R] sparse PCA using nsprcomp package

2013-09-11 Thread array chip
Hi Christian, Thank you so much for sharing your thoughts, I was a real pleasure to read and learn! Approximately when do you expect the new release of the package? Best, John From: Christian Sigg Cc: "r-help@r-project.org" Sent: Monday, September 9, 20

Re: [R] sparse PCA using nsprcomp package

2013-09-05 Thread array chip
HI Christian, Thanks so much for the detailed explanation! I look forward to the new release of nsprcomp package! At the meantime, I will use the function below for calculation of "adjusted" standard deviation. I have 2 more questions, hope you can shed some lights on: 1). Assume now I can cal

[R] sparse PCA using nsprcomp package

2013-09-05 Thread array chip
Hi all, I am using nsprcomp() from nsprcomp package to run sparse PCA. The output is very much like regular PCA by prcomp() in that it provides "sdev" for standard deviation of principle components (PC). For regular PCA by prcomp(), we can easily calculate the percent of total variance explai

[R] meta-analysis for sensitivity

2013-04-08 Thread array chip
Hi all, I am new to meta-analysis. Is there any special package that can  calculate "summarized" sensitivity with 95% confidence interval for a diagnostic test, based on sensitivities from several individual studies?  Thanks for any suggestions. John From:

[R] cnfidence intervals for survfit()

2013-03-14 Thread array chip
Hi, I am wondering how the confidence interval for Kaplan-Meier estimator is calculated by survfit(). For example,  > summary(survfit(Surv(time,status)~1,data),times=10) Call: survfit(formula = Surv(rtime10, rstat10) ~ 1, data = mgi)  time n.risk n.event survival std.err lower 95% CI upper 95% C

[R] error installing KEGGSOAP

2013-01-16 Thread array chip
Hi, I am new to bioconductor, trying to install KEGGSOAP package, but got warnings() when installing and error message when trying to load the package, can anyone suggest what went wrong? many thanks John > source("http://bioconductor.org/biocLite.R";) Bioconductor version 2.11 (BiocInstalle

Re: [R] weird merge()

2013-01-11 Thread array chip
I just figured out the reason was the column (the 1st column in each data frame "gene.name") by which to merge each data frame has no unique values, some values were repeated, so when merging, the data frame gets bigger and bigger exponentially. Sorry to bother all. John ___

Re: [R] weird merge()

2013-01-11 Thread array chip
Hi Dennis, Actually, I am trying to combine them by COLUMN, so that's why I am using merge(). The first loop was to simply read these protein data into R as 11 data frames, each data frame is 165 x 2. Then I use merge() to combine these data frames into 1 big data frame by column with these in

Re: [R] weird merge()

2013-01-11 Thread array chip
Hi James, I am trying to combine 11 data frames by column, not by row. My original message has 11 data text files attached, did they go through so you can try my codes? Thanks John From: J Toll Cc: "r-help@r-project.org" Sent: Friday, January 11, 2013

Re: [R] sort matrix based on a specific order

2013-01-10 Thread array chip
ion of the vector 'ind' and to order that permutation gives its inverse. mat <- cbind(c('w','x','y','z'),c('a','b','c','d')) ind <- c('c','b','d','a') or

[R] sort matrix based on a specific order

2013-01-10 Thread array chip
Hi I have a character matrix with 2 columns A and B, If I want to sort the matrix based on the column B, but based on a specific order of characters: mat<-cbind(c('w','x','y','z'),c('a','b','c','d')) ind<-c('c','b','d','a') I want "mat" to be sorted by the sequence in "ind": [,1] [,2] [1,]

[R] NRI or IDI for survival data - Hmisc package

2012-11-27 Thread array chip
Hi, I am trying to calculate net reclassification improvement (NRI) and Inegrated Discrimination Improvement (IDI) for a survival dataset to compare 2 risk models. It seems that the improveProb() in Hmisc package does this only for binary outcome, while rcorrp.cens() does take survival object, b

Re: [R] decimal points midline

2012-08-08 Thread array chip
Thanks Uwe, options(OutDec="\xB7") worked! From: Uwe Ligges To: John Kane roject.org> Sent: Wednesday, August 8, 2012 12:43 PM Subject: Re: [R] decimal points midline On 08.08.2012 21:22, John Kane wrote: > Can you point to an example?  It sounds like the

[R] decimal points midline

2012-08-08 Thread array chip
Hi, does anyone know how to make decimal points midline when plotting? The journal to which we are going to submit a manuscript require this particular formatting, and it gives direction how to do this on PC: hold down ALT key and type 0183 on the number pad Thanks John [[alternative H

Re: [R] a simple mixed model

2012-05-27 Thread array chip
9 AM Subject: Re: [R] a simple mixed model On May 27, 2012, at 07:12 , array chip wrote: > Hi, I was reviewing a manuscript where a linear mixed model was used. The > data is simple: a response variable "y" was measured for each subject over 3 > time points (visit 1, 2 and

[R] a simple mixed model

2012-05-26 Thread array chip
Hi, I was reviewing a manuscript where a linear mixed model was used. The data is simple: a response variable "y" was measured for each subject over 3 time points (visit 1, 2 and 3) that were about a week apart between 2 visits. The study is a non-drug study and one of the objectives was to eval

Re: [R] low R square value from ANCOVA model

2012-05-08 Thread array chip
Paul, thanks for your thoughts. blunt, not at all If I understand correctly, it doesn't help anything to speculate whether there might be additional variables existing or not. Given current variables in the model, it's perfectly fine to draw conclusions based on significant coefficients reg

Re: [R] low R square value from ANCOVA model

2012-05-08 Thread array chip
n on this argument? Many thanks! John From: peter dalgaard Cc: "r-help@r-project.org" Sent: Monday, May 7, 2012 11:43 PM Subject: Re: [R] low R square value from ANCOVA model On May 8, 2012, at 08:34 , array chip wrote: > Thank you Pe

Re: [R] low R square value from ANCOVA model

2012-05-08 Thread array chip
John From: peter dalgaard Cc: "r-help@r-project.org" Sent: Monday, May 7, 2012 11:43 PM Subject: Re: [R] low R square value from ANCOVA model On May 8, 2012, at 08:34 , array chip wrote: > Thank you Peter, so if I observe a significant coefficient, that sig

Re: [R] low R square value from ANCOVA model

2012-05-08 Thread array chip
dalgaard Cc: "r-help@r-project.org" Sent: Monday, May 7, 2012 11:07 PM Subject: Re: [R] low R square value from ANCOVA model On May 8, 2012, at 05:10 , array chip wrote: > Hi, what does a low R-square value from an ANCOVA model mean? For example, if > the R square from the mo

[R] low R square value from ANCOVA model

2012-05-07 Thread array chip
Hi, what does a low R-square value from an ANCOVA model mean? For example, if the R square from the model is about 0.2, does this mean the results should NOT be trusted? I checked the residuals of the model, it looked fine...   Thanks for any suggestion.   John [[alternative HTML version

Re: [R] Difference in Kaplan-Meier estimates plus CI

2012-04-05 Thread array chip
Hi, I have the same question as Jason on how to estimate the standard error and construct CI around S_1(t) - S_2(t). From summary.survfit(obj), how can I combine the 2 survival estimates and the associated standard errors, to get an estimate of standard error for the difference / then calculate

[R] statistical contrasts on 3-way interaction

2012-03-14 Thread array chip
Hi all,  I was trying to use glht() from multcomp package to construct a contrast on interaction term in a linear model to do some comparisons. I am little uncertain on how to construct contrasts on a 3-way interaction containing a continuous variable, and hope someone can confirm what I did i

Re: [R] "CV" for log normal data

2012-02-21 Thread array chip
Thank you Peter. John From: Peter Langfelder To: Bert Gunter Sent: Tuesday, February 21, 2012 2:51 PM Subject: Re: [R] "CV" for log normal data > > Good advice. But perhaps ?mad or some other perhaps robust plain old > measure of spread? The problem is n

[R] "CV" for log normal data

2012-02-21 Thread array chip
Hi, I have a microarray dataset from Agilent chips. The data were really log ratio between test samples and a universal reference RNA. Because of the nature of log ratios, coefficient of variation (CV) doesn't really apply to this kind of data due to the fact that mean of log ratio is very close

[R] prediction for linear mixed model

2012-02-20 Thread array chip
Hi, I am wondering if we can make prediction on a linear mixed model by lmer() from lme4 package? Specifically I am fitting a very simple glmer() with binomial family distribution, and want to see if I can get the predicted probability like that in regular logistic regression?   fit<-glmer(y~x+(

Re: [R] standard error for lda()

2012-02-09 Thread array chip
9, 2012 2:59 PM Subject: Re: [R] standard error for lda() On Feb 9, 2012, at 4:45 PM, array chip wrote: > Hi, didn't hear any response yet. want to give it another try.. appreciate > any suggestions. > My problem after reading this the first time was that I didn't agr

[R] standard error for lda()

2012-02-09 Thread array chip
Hi, didn't hear any response yet. want to give it another try.. appreciate any suggestions. John To: "r-help@r-project.org" Sent: Wednesday, February 8, 2012 12:11 PM Subject: [R] standard error for lda() Hi, I am wondering if it is possible to get an estima

[R] standard error for lda()

2012-02-08 Thread array chip
Hi, I am wondering if it is possible to get an estimate of standard error of the predicted posterior probability from LDA using lda() from MASS? Logistic regression using glm() would generate a standard error for predicted probability with se.fit=T argument in predict(), so would it make sense t

[R] forest plots from rmeta package

2011-11-21 Thread array chip
Hi, I am trying forestplot() and metaplot() from rmeta package to plot some hazard ratios. Now foreatplot() can draw clipping with "<" or ">" at the ends of the confidence line using "clip" argument, but can't use multiple colors for different lines. On the other hand, metaplot() can use differe

Re: [R] why NA coefficients

2011-11-08 Thread array chip
reat 1 2 >>     1 8 0 >>     2 1 5 >>     3 5 5 >>     4 7 3 >>     5 7 4 >>     6 3 3 >>     7 8 2 >> >> But why the coefficient for "treat 7-group 2" is not estimable? >> >> Thanks >> >> John >> >>

Re: [R] why NA coefficients

2011-11-08 Thread array chip
true, why it has to omit "treat 7-group 2" Thanks again From: David Winsemius Cc: "r-help@r-project.org" Sent: Monday, November 7, 2011 10:19 PM Subject: Re: [R] why NA coefficients On Nov 7, 2011, at 10:07 PM, array chip wrote:

Re: [R] why NA coefficients

2011-11-08 Thread array chip
>> John >> >> >> From: David Winsemius >> Cc: "r-help@r-project.org" >> Sent: Monday, November 7, 2011 5:13 PM >> Subject: Re: [R] why NA coefficients >> >> >> On Nov 7, 2011, at 7:33 PM, array chip wrote: >> >> &g

Re: [R] why NA coefficients

2011-11-07 Thread array chip
> > But why the coefficient for "treat 7-group 2" is not estimable? > > Thanks > > John > > > > > > From: David Winsemius > > Cc: "r-help@r-project.org" > Sent: Monday, November 7, 2011 5:13 PM > Subje

Re: [R] why NA coefficients

2011-11-07 Thread array chip
imable?   Thanks John From: David Winsemius Cc: "r-help@r-project.org" Sent: Monday, November 7, 2011 5:13 PM Subject: Re: [R] why NA coefficients On Nov 7, 2011, at 7:33 PM, array chip wrote: > Hi, I am trying to run ANOVA with an interaction term on 2 factors

[R] why NA coefficients

2011-11-07 Thread array chip
Hi, I am trying to run ANOVA with an interaction term on 2 factors (treat has 7 levels, group has 2 levels). I found the coefficient for the last interaction term is always 0, see attached dataset and the code below: > test<-read.table("test.txt",sep='\t',header=T,row.names=NULL) > lm(y~factor(t

[R] compare proportions

2011-09-28 Thread array chip
Hi all, I asked this yesterday, but hadn't got any response yet. Understand this is not pure R technical question, but more of statistical. With many statistical experts in the list, I would appreciate any suggestions... Many thanks John -- Hi,

[R] compare proportions

2011-09-27 Thread array chip
Hi, I have a seemingly simple proportional test.  here is the question I am trying to answer:   There is a test running each day in the lab, the test comes out as either positive or negative. So at the end of each month, we can calculate a positive rate in that month as the proportion of positive

[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

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

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,

[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] 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] 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

[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

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

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

[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] 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] 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] 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

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-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:

  1   2   3   >