[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'),

[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

[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='')))

Re: [R] compare odds ratios

2006-06-27 Thread array chip
: 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 compare 2 odds ratios? I

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

[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

[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

[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] 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 time,status and scores, all numeric If I run

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 the fisher's exact test on a 2x2 table

Re: [R] fisher table probability

2006-02-02 Thread array chip
) 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 is greater than 2, say 3x4? Look at the references quoted

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

[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

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 2000. I

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

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 there a way to only have the plotting area

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

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

Re: [R] color palette

2005-08-04 Thread array chip
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 already available) that treat negative numbers in a blue gradient

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

[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

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] [mailto:[EMAIL PROTECTED] On Behalf Of array chip

RE: [R] multinom and contrasts

2005-04-14 Thread array chip
,] predict(obj2,type='probs')[1:5,] appreciate any suggestions! --- John Fox [EMAIL PROTECTED] wrote: Dear chip, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of array chip Sent: Thursday, April 14, 2005 1:00 PM To: John Fox Cc: R-help

[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

[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

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

[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

[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 24 0

[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 100.62 4

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

2004-12-14 Thread array chip
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 called a and b, both have 3

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

2004-12-14 Thread array chip
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 actually data frame b has 177 rows, the script ran ok on the first 166 rows as a subset, but started to break down

[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$table[,3]

Re: [R] time dependency of Cox regression

2004-11-03 Thread array chip
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 survival changes/diminishes with time? The value of the covariate was only recorded once

[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

[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

[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

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

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

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

[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

[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

[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

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

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

2003-10-02 Thread array chip
learning process. -- George E.P. Box -Original Message- From: array chip [mailto:[EMAIL PROTECTED] Sent: Thursday, October 02, 2003 12:42 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: [S] lme vs. aov with Error term Hi, I have a question about using lme

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

[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 past.

RE: [R] memory problem in exporting data frame

2003-09-09 Thread array chip
). 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 Behalf Of Thomas W Blackwell Sent: den 9 september 2003 01:28 To: array chip

Re: [R] memory problem in exporting data frame

2003-09-08 Thread array chip
has 1G as well and my problem was a numeric matrix that was 5000 square. So you should have no problem. Patrick Burns Burns Statistics [EMAIL 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

[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

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

[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

[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

[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

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

Re: [R] probelem of function inside function

2003-06-25 Thread array chip
, 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 idenfity the problem for me. snip f.fun(var='x',fdata=testdata

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

2003-06-03 Thread array chip
, '') 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. 48). hth. spencer graves array chip wrote: Hi, I am running cox regreesion (coxph) on a large

[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