[R] Rcmdr scatter3d

2007-09-04 Thread array chip
Hi, I am using the scatter3d function in Rcmdr to plot the first 3 principal components, I have a grouping variable of 2 groups, and tried to plot points with different colors, somehow I couldn't change the default colors of the 2 groups (blue and green)by using option points.col=c('red','blue'), w

[R] bimodal / trimodal

2006-10-09 Thread array chip
Hi, is there any package/function that can tell if a numeric vector (continuous data) has a bimodal or trimodal distribution and caluclate the location of the corresponding modes? Thanks __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mail

[R] write.table to Excel file

2006-08-31 Thread array chip
Hi, I found that when writing a matrix with row names and column names to an Excel file, the Excel file when opened has column names shifted towards left resulting disalignment. Here is an exmaple x<-matrix(1:20,nrow=4,dimnames=list(paste('r',1:4,sep=''),paste('c',1:5,sep=''))) write.table(x,"xx.x

Re: [R] compare odds ratios

2006-06-27 Thread array chip
or example: dat<-cbind(disease=sample(c(rep(1,15),rep(0,20))),test1=sample(c(rep(1,11),rep(0,24))),test2=sample(c(rep(1,14),rep(0,21 Hope some statistical experts would guide me some directions. Many thanks --- array chip <[EMAIL PROTECTED]> wrote: > Hi there, is there any way to

[R] compare odds ratios

2006-06-26 Thread array chip
Hi there, is there any way to compare 2 odds ratios? I have two tests that are supposed to detect a disease presence. So for each test, I can compute an odds ratio. My problem is how can I compare the 2 tests by testing whether the 2 odds ratios are the same? Appreciate __

[R] comparing 2 odds ratios

2006-06-26 Thread array chip
Hi there, is there any way to compare 2 odds ratios? I have two tests that are supposed to detect a disease presence. So for each test, I can compute an odds ratio. My problem is how can I compare the 2 tests by testing whether the 2 odds ratios are the same? Appreciate __

[R] plot with different color

2006-06-02 Thread array chip
Hi how can I plot a series of number as a line, but with lines above a threshould as one color, and with lines below the threshold as another color. for example, a numeric vector: rnorm(1:100), and plot these numbers in the original order, but lines above the horizontal line at 0 are in red, and li

[R] post hoc comparison in repeated measure

2006-05-10 Thread array chip
I haven't heard from anyone with my previous post. I guess I should post my dataset and my code here: The dataset has one factor as treatment with 4 levels (treatment1, treatment2, treatment3 and control), and another factor as time (36 time points). On average Each treatment group has 10 subjects

[R] post hoc comparison in repeated measure

2006-05-09 Thread array chip
Hi, I have a simple dataset with repeated measures. one factor is treatment with 3 levels (treatment1, treatment2 and control), the other factor is time (15 time points). Each treatment group has 10 subjects with each followed up at each time points, the response variable is numeric, serum protein

Re: [R] cph() in Design package

2006-04-11 Thread array chip
sorry this problem only occurs in S-Plus, not in R. --- array chip <[EMAIL PROTECTED]> wrote: > Hi there, I encountered a weird problem using cph() > with Design package: > > I have 2 datasets, say "dat1" and "dat2", both data > frames with 3 columns &q

[R] cph() in Design package

2006-04-11 Thread array chip
Hi there, I encountered a weird problem using cph() with Design package: I have 2 datasets, say "dat1" and "dat2", both data frames with 3 columns "time","status" and "scores", all numeric If I run the following: dd<-datadist(dat1) options(datadist='dd') dd time status scores

Re: [R] fisher table probability

2006-02-02 Thread array chip
mma(sum(x[,j])+1) tmp<-tmp-lgamma(x[i,j]+1) } } tmp<-tmp-lgamma(sum(x)+1) exp(tmp) } --- Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Thu, 2 Feb 2006, array chip wrote: > > > Thanks for the suggestion! what if the dimensions > of > > the table

Re: [R] fisher table probability

2006-02-02 Thread array chip
Thanks for the suggestion! what if the dimensions of the table is greater than 2, say 3x4? --- Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Wed, 1 Feb 2006, array chip wrote: > > > Hi, is there a way to generate the table's > probability > > when doing

[R] fisher table probability

2006-02-01 Thread array chip
Hi, is there a way to generate the table's probability when doing the fisher's exact test on a 2x2 table? The fisher's exact test gives the p value, but not the probability for the table. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mail

[R] format of 2x2 table

2006-02-01 Thread array chip
Does anyone know how I can generate a 2x2 table in a format where in each cell of the table, it contains a) count (frequency) b) total percentage c) row percentage d) column percentage. SAS can generate this format easily, is there a R package that can do this? Frequency | Percent | Row Pct |

Re: [R] langugae settings

2005-12-09 Thread array chip
You can change the language setting during the installation, it is just not that obvious though.In the "selection components" step of installation, uncheck the "message translations".It should be OK then. --- Ariel Bergamini <[EMAIL PROTECTED]> wrote: > Hi > > I just installed R 2.2.0 on Windows

[R] axis label justified

2005-08-18 Thread array chip
Hi, I am trying to make my axis labels left justified, and have used adj=0 in the axis() without success. Can anyone have a suggestion? axis(2,at=1:50,labels=paste('a',1:50,sep=''),las=2,cex.axis=0.5,adj=0,tck=0,mgp=c(3,0.5,0)) Thanks __ R-help@stat.ma

Re: [R] background colors in image()

2005-08-11 Thread array chip
Romain, Thanks for the code. It worked perfectly! --- Romain Francois <[EMAIL PROTECTED]> wrote: > Le 11.08.2005 00:59, array chip a écrit : > > >Thanks for the suggestion! It works in a way that > the > >entire graph window is in the background color, is >

Re: [R] background colors in image()

2005-08-10 Thread array chip
Thanks for the suggestion! It works in a way that the entire graph window is in the background color, is there a way to only have the plotting area (i.e. the area within the axis box in the background color, but leave the area outside the axes to be unchanged (white)? Thanks! --- Prof Brian Riple

[R] background colors in image()

2005-08-10 Thread array chip
Hi, I am using image() function to plot a matrix which has some missing valuies (NA). It looks like, by default, missing values were drawn in white color, How can I change that into a different color, say a gray color? I tried to use bg='gray' argument with no luck. Anyone has a suggestion? Thanks

Re: [R] color palette

2005-08-04 Thread array chip
ey <[EMAIL PROTECTED]> wrote: > On Wed, 3 Aug 2005, array chip wrote: > > > Hi, I have a matrix with both positive and > negative > > numbers, I would like to use image() to draw a > > heatmap. How can I can design a palette (or is > there a > > function alr

[R] color palette

2005-08-03 Thread array chip
Hi, I have a matrix with both positive and negative numbers, I would like to use image() to draw a heatmap. How can I can design a palette (or is there a function already available) that treat negative numbers in a blue gradient and positive numbers in a red gradient and treat 0 as white? Thanks

[R] memory limit

2005-08-02 Thread array chip
Hi, is it possible to increase the memory limit to infinite so that I don't need to worry about whether it is enough or not? In S-plus, you can do this by setting: options( memory = as.integer( Inf ) ) is it possible to do this in R? __ R-help@stat.mat

[R] ANOVA with both discreet and continuous variable

2005-04-22 Thread array chip
Hi all, I have dataset with 2 independent variable, one (x1) is continuous, the other (x2) is a categorical variable with 2 levels. The dependent variable (y) is continuous. When I run linear regression y~x1*x2, I found that the p value for the continuous independent variable x1 changes when diffe

[R] cross validation and parameter determination

2005-04-19 Thread array chip
Hi all, In Tibshirani's PNAS paper about nearest shrunken centroid analysis of microarrays (PNAS vol 99:6567), they used cross validation to choose the amount of shrinkage used in the model, and then test the performance of the model with the cross-validated shrinkage in separate independent testi

RE: [R] multinom and contrasts

2005-04-14 Thread array chip
7;)) obj1<-multinom(class~.,sample,weights=wts2,maxit=1000) options(contrasts=c('contr.treatment','contr.poly')) obj2<-multinom(class~.,sample,weights=wts2,maxit=1000) predict(obj1,type='probs')[1:5,] predict(obj2,type='probs')[1:5,] appreciate any sugg

RE: [R] multinom and contrasts

2005-04-14 Thread array chip
-- > John Fox > Department of Sociology > McMaster University > Hamilton, Ontario > Canada L8S 4M4 > 905-525-9140x23604 > http://socserv.mcmaster.ca/jfox > > > > -Original Message- > > From: [EMAIL PROTECTED] > &g

[R] multinom and contrasts

2005-04-13 Thread array chip
Hi, I found that using different contrasts (e.g. contr.helmert vs. contr.treatment) will generate different fitted probabilities from multinomial logistic regression using multinom(); while the fitted probabilities from binary logistic regression seem to be the same. Why is that? and for multinomi

[R] multi-class modeling

2005-04-10 Thread array chip
Hi, Just wonder if someone could comment on using linear discriminant analysis (LDA) vs. multinomial logistic regression in multi-class classification/prediction (nomial dependent variable, not ordinal)? What kind of difference in results can I expect from the 2 methods, which is better or more ap

[R] bootstrap vs. resampleing

2005-04-06 Thread array chip
Hi, I understand bootstrap can be used to estimate 95% confidence interval for some statistics, e.g. variance, median, etc. I have someone suggesting that by resampling certain proportion of the total samples (e.g. 80%) without replacement, we can also get the estimate of confidence intervals. Her

[R] main effect & interaction in 2-way ANOVA

2005-02-24 Thread array chip
Hi, I am just a little confused of mian effect in the analysis of variance (ANOVA) when you include or do not include an interaction term. Let's assume a simple case of 2-way ANOVA with 2 factors A and B, each with 2 levels. If it shows that main effect for A is significant when the interaction be

[R] no. at risk in survfit()

2005-02-04 Thread array chip
Hi, when I generated a survfit() object, I can get number of patients at risk at various time points by using summary(): fit<-survfit(Surv(time,status)~class,data=mtdata) summary(fit) class=1 time n.risk n.event survival std.err lower 95% CI upper 95% CI 9.9 78

[R] using Hmisc and Design library

2004-12-15 Thread array chip
Hi all, I encountered a weird problem when using the Design and Hmisc libraries in S-Plus (it worked well in R). I have a data frame called "b", which has 3 columns: "time", "status" and "scores", a sample of the data frame is like: data frame "b": time status scores 1 27 0 -126.7 2 2

RE: [R] Re: [S] using Hmisc and Design library

2004-12-14 Thread array chip
ginal Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] Behalf > Of array chip > > Sent: Tuesday, December 14, 2004 4:28 PM > > To: [EMAIL PROTECTED]; > [EMAIL PROTECTED] > > Subject: [R] Re: [S] using Hmisc and Design > library > > > &

[R] Re: [S] using Hmisc and Design library

2004-12-14 Thread array chip
-123.3 166 105 0 -138.4 167 166 0 -128.8 168 140 0 -114.2 169 163 0 -117.0 170 141 0 -115.8 please advise! --- array chip <[EMAIL PROTECTED]> wrote: > Hi, I encountered a weird problem when using the > Design and Hmisc problem. I have 2 data frame call

[R] using Hmisc and Design library

2004-12-14 Thread array chip
Hi, I encountered a weird problem when using the Design and Hmisc problem. I have 2 data frame called "a" and "b", both have 3 columns: "time", "status" and "scores", a sample of the data frame is like: data frame "a": time status scores 1 21 1 99.61 2 38 0 101.11 3 51 0 1

[R] contrast reference level

2004-12-02 Thread array chip
suppose I have a factor with 4 levels: 'a','b','c','d'. I would like to do analysis of variance using aov() with the factor as independent variable. How can I specify the level "b" as the reference level just like the level "a" would be the reference level if using contr.treatment as the contrast?

[R] worked in R, but not in S-Plus

2004-11-09 Thread array chip
Hi, I wrote a function that worked well in R, but not in S-Plus, can anyone suggest a solution? > f.coxph.zph<-function(x) { cox.fit <- coxph(Surv(time.cox, status.cox) ~ x, na.action = na.exclude, method = "breslow") fit.zph<-cox.zph(cox.fit,transform='log') fit.zph$tabl

Re: [R] time dependency of Cox regression

2004-11-03 Thread array chip
this a reasonable way to do it? Thanks --- Thomas Lumley <[EMAIL PROTECTED]> wrote: > > array chip wrote: > >> Hi, > >> > >> How can I specify a Cox proportional hazards > model > >> with a covariate which i believe its strength on > >&

[R] time dependency of Cox regression

2004-11-02 Thread array chip
Hi, How can I specify a Cox proportional hazards model with a covariate which i believe its strength on survival changes/diminishes with time? The value of the covariate was only recorded once at the beginning of the study for each individual (e.g. at the diagnosis of the disease), so I do not hav

[R] multinomial logistic regression with prior probability

2004-10-19 Thread array chip
Hi, Is there a way to specify proior probability in multinom()? The function has a weight option for individual cases, but I would like to specify prior probability for each category of the response variable, just like what lda() does. My data have categorical independent variables, so I think lda

[R] multinomial logistic regression with prior probability

2004-10-18 Thread array chip
Hi, Is there a way to specify proior probability in multinom()? The function has a weight option for individual cases, but I would like to specify prior probability for each category of the response variable, just like what lda() does. My data have categorical independent variables, so I think lda

[R] multinomial logistic regression

2004-09-22 Thread array chip
Hi, how can I do multinomial logistic regression in R? I think glm() can only handle binary response variable, and polr() can only handle ordinal response variable. how to do logistic regression with multinomial response variable? Thanks __ Y! Me

[R] survival analysis sampling question

2004-05-21 Thread array chip
Hi, not sure if this is the best place to ask this statistical question, but here it goes: Does doing survival analysis mandatorily require consecutively recruited patients? If I have a retrospective patient sample, but not consecutively recruited, does it necessitate invalidity of the use of surv

[R] interval-censored data in coxph

2004-05-21 Thread array chip
Hi, I am wondering how to specify interval-censored data in coxph? The example in the help page summary(coxph(Surv(start, stop, event) ~ x, data = test2)) is for counting process data, is the counting process data the same as interval-censored data? Thanks

[R] axis label character bolder

2004-04-19 Thread array chip
Hi, how can I make the character label of the axes of a plot darker (bolder), but not in a larger size? __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/pos

[R] access R remotely

2004-03-11 Thread array chip
Hi, not sure if this is kind of question that should be asked here, but here it is: I am trying to access R installed on a remote cluster (Linus), but I got the error message that R command not found when I simply typed "R" after the prompt after having successfully accessed the remote cluster us

[R] plot of survival probability vs. covariate

2003-12-11 Thread array chip
Hi everyone, I am fitting a cox proportional hazard model with a continuous variable "x" as the covariate: fit<-coxph(Surv(time, status)~x) Now I wanted to make a plot of survival probability vs. the covariate, and the 95% confidence interval for the survival probability. It's just like a Kaplan

[R] linear discriminant analysis

2003-10-23 Thread array chip
Hi all, When I use "lda" for discriminant analysis, should I normalized my data (variables) to mean 0, variance 1 before running "lda" if my variables might not be exactly on the same scale? I have this question because in principle component analysis, this is indeed an issue where we can choose c

[R] Re: [S] lme vs. aov with Error term

2003-10-02 Thread array chip
Jose, Thank you very much for the explanation! what about if I specify using "ML" instead of "REML" in the lme? I found that I still got different answers even I use "ML" in the lme call. And in any case, should I trust "lme" more than "aov", or vice versa? Thanks again --- [EMAIL PROTECTED]

[R] RE: [S] lme vs. aov with Error term

2003-10-02 Thread array chip
> P.O. Box 2000 > Rahway, NJ 07065-0900 > Phone: (732) 594-7765 > mailto: [EMAIL PROTECTED] > > "The business of the statistician is to catalyze the > scientific learning > process." -- George E.P. Box > > > > -Original Message- > From: array

[R] lme vs. aov with Error term

2003-10-02 Thread array chip
Hi, I have a question about using "lme" and "aov" for the following dataset. If I understand correctly, using "aov" with an Error term in the formula is equivalent to using "lme" with default settings, i.e. both assume compound symmetry correlation structure. And I have found that equivalency in t

[R] lme vs. aov

2003-09-30 Thread array chip
Hi, I have a question about using "lme" and "aov" for the following dataset. If I understand correctly, using "aov" with Error term in the formula is equivalent to using "lme" with default settings, i.e. both assume compound symmetry correlation structure. And I have found that equivalency in the

RE: [R] memory problem in exporting data frame

2003-09-09 Thread array chip
is a matrix). In > other words, the only thing you will gain is a > smaller 'xxx' object. > > Best wishes > > Henrik Bengtsson > Lund University > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On > Beha

Re: [R] memory problem in exporting data frame

2003-09-08 Thread array chip
PROTECTED] > +44 (0)20 8525 0696 > http://www.burns-stat.com > (home of S Poetry and "A Guide for the Unwilling S > User") > > array chip wrote: > > >Hi, > > > >I am having trouble of exporting a large data frame > >out of R to be used in other purp

[R] memory problem in exporting data frame

2003-09-08 Thread array chip
Hi, I am having trouble of exporting a large data frame out of R to be used in other purpose. The data frame is numeric with size 17000x400. It takes a quite some time to start R as well. my computer has 1GB RAM. I used the following command to write the data frame to a text file and got the error

[R] nls fitting inside a loop in S-Plus

2003-08-21 Thread array chip
Hi, this following problem is a S-Plus problem, I know many guys here are also experts in S-plus, so I am posting here, too. Thanks I encountered a weird problem of fitting nls inside a loop, it works well in R, but not in S-plus. The code is: > data1<-cbind(c(2.87,1.66,0.44,-0.78,-2.00,-3.21,

[R] graphic widow overwrite

2003-08-21 Thread array chip
Hi, I am running a loop to plot multiple plots. In s-plus, it shows multiple pages in the graphic window to allow checking on each plot. but in R, the next plot always overwrite the previous one, so i can only have the last plot produced, is there a way to have multiple pages in the graphic window

[R] 4 parameter logistic model

2003-08-20 Thread array chip
Hi, I am trying to fit a 4-parameter logistic model to my gradient data using nls. I tried to specify the model directly in the nls formula and also tried to use the self-start function SSfpl. For the following data, the first method worked, but the second didn't. I thought both ways were equivalen

[R] princomp scores reproduced

2003-08-18 Thread array chip
Hi, I used "princomp" for PCA analysis based on correlation matrix (cor=T). I would like to reproduce the scores for each observation by first standardizing the data matrix (mean=0, std err=1), and then multiplied by the loadings of each variable for each principle components. I get very close num

[R] leave-one-out

2003-08-14 Thread array chip
Hi, is there a package for performing leave-one-out cross validation in R? __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Re: [R] probelem of function inside function

2003-06-25 Thread array chip
d, 25 Jun 2003, array chip wrote: > > > Hi, > > > > I encountered a problem when I am trying to write > my > > own function which contains another function. To > > simplify a problem, I tried the following > simplified > > function, hope someone can idenfi

[R] probelem of function inside function

2003-06-25 Thread array chip
Hi, I encountered a problem when I am trying to write my own function which contains another function. To simplify a problem, I tried the following simplified function, hope someone can idenfity the problem for me. I have a simple data frame called "testdata" as following: > testdata<-data.frame

[R] R packages in S-Plus?

2003-06-05 Thread array chip
Hi, is it possible to use the packages from CRAN in SPlus? and how to do it if yes? __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Re: [R] catch error/warning message in a loop

2003-06-03 Thread array chip
like "cat(i, > '')" in the loop (where "i" is the index of the > loop). > > If I'm writing a function to be used by others, I > might use "try", as > described, e.g. in Venables and Ripley (2000) S > Programming (p.

[R] catch error/warning message in a loop

2003-05-31 Thread array chip
Hi, I am running cox regreesion (coxph) on a large number of independent variables, one variable at a time, using loop. At some point of the loop, the cox regression stopped due to some errors. How can I know at which variable the cox regression stopped so that I can pinpoint the variable that caus

Re: [R] Re: point-biserial correlation

2003-04-04 Thread array chip
Also, can you generalize it to polyserial correlation to handle when x has more than 3 categories? Noel Yvonnick <[EMAIL PROTECTED]> wrote:Le Lundi 31 Mars 2003 17:23, Bernd Weiss a écrit : > On 31 Mar 2003 at 15:07, Noel Yvonnick wrote: > > [...] > > > Note that the point-biserial correlation

Re: [R] Re: point-biserial correlation

2003-04-04 Thread array chip
Noel, Thanks for sharing the code to the R community. I am new to biserial correlation, and had just tried your code for the following data: > cor.biserial(as.factor(c(0,1,0,0,0,1,1,0,1,1,1)), c(1.2, 4.5, 0.97, 1.02, > 1.4,3.8,3.97,1.23,3.78,4.23,4.76)) $rbis: 0 -1.233783 $rhobis:

[R] lda of MASS library

2003-04-01 Thread array chip
Hi, it seems that the lda function in MASS library doesn't give out the constant for the linear discriminant function under the situation that we don't use standardized variable, anyone knows how to obtain the constant in order to construct the linear discriminant function? I understand that

[R] LDA

2003-04-01 Thread array chip
I used the "lda" function in the MASS library of S-Plus (R) to do a linear discriminant analysis, and got the linear coefficients, say b1 and b2 for the 2 predictors x1 and x2. I have trouble to calculate the discrimiant scores for each observation, I used 3 ways to try to repeat the scores ret