Re: [R] Stacked barchart color

2007-06-16 Thread hadley wickham
On 6/16/07, owenman [EMAIL PROTECTED] wrote: Hi Hadley, I tried your suggestion, using ggplot2, but I am still having a problem. The final plot lacks the figure legend -- which it had before I added the scale_fill_identity() bit. Can you see what I am doing wrong? (By the way, all I am

Re: [R] R vs. Splus in Pharma/Devices Industry

2007-06-16 Thread Simon Blomberg
Furthermore, one day we will all be doing our statistics in C. So higher level programming is predicted to become more difficult! Cheers, Simon. Simon Blomberg, BSc (Hons), PhD, MAppStat. Lecturer and Consultant Statistician Faculty of Biological and Chemical Sciences The University of

Re: [R] [Not R question]: Better fit for order probit model

2007-06-16 Thread adschai
Thank you so much Robert. I haven't thought about the idea of clumping categories together. One of the reason is because these categories are bridge condition rating scores. They indeed represent different meaning and serviceability conditions. They vary from 0-9. I have about 300,000 data in

[R] similarity

2007-06-16 Thread Birgit Lemcke
Hello I have a question about performing a similarity analysis using R. I will perform a similarity analysis comparing species. I have a datamatrix that looks like the Pictures you can see in the mail. It contains bivariate data and data in this Min Max mode. I had to alter the multivariate

[R] Define tick mark width

2007-06-16 Thread Sébastien
Hello, Is there a way to define the width of the axis tick marks on traditionnal plots? I did not find anything specific on this topic in the help and par(lwd=...) does not affect the tick marks. I guess that using axes=FALSE and recreating the axis with the axis() command could do the trick

[R] linear hypothesis test in gls model

2007-06-16 Thread Tine Huyghe
Dear all, For analysis of a longitudinal data set with fixed measurement in time I built a gls model (nlme). For testing hypotheses in this model I used the linear.hypothesis function from the car package. A check with the results obtained in SAS proc MIXED with a repeated statement revealed

Re: [R] R vs. Splus in Pharma/Devices Industry

2007-06-16 Thread Ted Harding
On 16-Jun-07 01:12:18, Marc Schwartz wrote: On Sat, 2007-06-16 at 00:43 +0100, [EMAIL PROTECTED] wrote: On 15-Jun-07 19:43:55, John Kane wrote: --- Douglas Bates [EMAIL PROTECTED] wrote: On 6/15/07, Nicholas Lewin-Koh [EMAIL PROTECTED] wrote: [...] I think you mean A, not Z. First

[R] Lines connecting the boxes in a boxplot

2007-06-16 Thread Arne Brutschy
Hello, I'm currently using a boxplot to visualize data for three different models. As I have three models, I'm plotting three parallel boxplots for each factor. This works fine - what I need now is a line connecting the medians of each boxplot of each model. I want to do this in order to

[R] Call-Tips

2007-06-16 Thread Felipe Carrillo
Hi: I am brand new to this group ( and To Tinn-R), so I have my first question: How do I turn on the Call-Tips? I went through the help and I have installed the SciViews but still can't get it to work. I would really appreciate your help. - TV dinner still

[R] Help in HMM commands

2007-06-16 Thread Regina Verghis
Respected Sir, I am working on Hidden Markov Models for count data. My data consist of number of new infectives in a ward per month. I have data for about 50 months. How can I fit a Hidden Markon Model to my data. I am using 'repeated' package('hidden' and 'chidden' arguments). I would

[R] Visualize quartiles of plot line

2007-06-16 Thread Arne Brutschy
Hello, I'm currently using a simple plot to visualize some mean values. I'm having ~200 datapoints on the x-axis, each has 10 records. I'm currently plotting only the mean value of each of the datapoints. What I need is a way to visualize the quartiles/error/whatever of these points. I thought

Re: [R] Upgraded FC4 to FC5 - unable to start device X11 in R

2007-06-16 Thread Patrick Connolly
On Sat, 16-Jun-2007 at 04:09PM +1200, Patrick Connolly wrote: | On Fri, 15-Jun-2007 at 01:50PM -0700, Li-Jung Liang wrote: | | | Hi, | | | | I upgraded my system from FC4 to FC5. So now I have R version 2.5.0 | | (2007-04-23). | | But I ran into a problem with starting device X11 (message

Re: [R] Visualize quartiles of plot line

2007-06-16 Thread hadley wickham
How about quantile regression? Have a look at http://had.co.nz/ggplot2/stat_quantile.html for some examples of what that might look like. Hadley On 6/16/07, Arne Brutschy [EMAIL PROTECTED] wrote: Hello, I'm currently using a simple plot to visualize some mean values. I'm having ~200

Re: [R] fSeries - Ox - ver: 240.10068 - Steps to make it work

2007-06-16 Thread Martin Becker
I think there is still a small bug which I reported some time ago to r-sig-finance (https://stat.ethz.ch/pipermail/r-sig-finance/2005q4/000498.html) and which takes effect if the time series is not stored in the variable 'x': The line write(x, file = OxSeries.csv, ncolumns = 1, append =

Re: [R] Visualize quartiles of plot line

2007-06-16 Thread Mark Difford
Hi Arne, You might also take a look at Prof. Harrell's function: require(Hmisc) ## req. library [note: also needs lattice] ?smedian.hilow Then look at: ?xYplot And, in particular, at: panel.xYplot(), sub Usage: This does what you want. ## Example; also look at Prof Harrell's

[R] Fwd: How to set degrees of freedom in cor.test?

2007-06-16 Thread Mike Lawrence
You could calculate the confidence interval of the correlation at your desired df: http://davidmlane.com/hyperstat/B8544.html The below code takes as arguments the observed correlation, N, and alpha, calculates the confidence interval and checks whether this includes 0.

Re: [R] question about formula for lm

2007-06-16 Thread Mike Lawrence
Yet another solution: with(X,lm(get(Ytext)~Xvar)) On 14-Jun-07, at 5:18 PM, Greg Snow wrote: Try: lm( formula( paste( Ytext, '~ Xvar' ) ), data=X) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original

Re: [R] fSeries - Ox - ver: 240.10068 - Steps to make it work

2007-06-16 Thread Ian Gregory
I tried the following and it works for me (after the changes to make): library(fSeries) data(dem2gbp) IanSeries = dem2gbp[, 1] garchOxFit(~garch(1,1),IanSeries) Any writing of data is performed in the GarchOxModelling.ox file. The number of lines of code in the function .garchOxFit() does not

Re: [R] fSeries - Ox - ver: 240.10068 - Steps to make it work

2007-06-16 Thread Martin Becker
Line number 55 in the original mail from 2005 was a reference to garchOxFit (not .garchOxFit) in fSeries version 220.10063 (not 240.10068), as mentioned in https://stat.ethz.ch/pipermail/r-sig-finance/2005q4/000498.html . Of course, in the current version of .garchOxFit, the line number has

Re: [R] selecting cut-off in Logistic regression using ROCR package

2007-06-16 Thread Frank E Harrell Jr
Tirthadeep wrote: Hi, I am using logistic regression to classify a binary psychometric data. using glm() and then predict.glm() i got the predicted odds ratio of the testing data. Next i am going to plot ROC curve for the analysis of my study. Now what i will do: 1. first select a

Re: [R] [Not R question]: Better fit for order probit model

2007-06-16 Thread Robert A LaBudde
At 03:17 AM 6/16/2007, adschai wrote: Thank you so much Robert. I haven't thought about the idea of clumping categories together. One of the reason is because these categories are bridge condition rating scores. They indeed represent different meaning and serviceability conditions. They vary

Re: [R] question about formula for lm

2007-06-16 Thread Douglas Bates
On 6/14/07, Greg Snow [EMAIL PROTECTED] wrote: Try: lm( formula( paste( Ytext, '~ Xvar' ) ), data=X) That type of construction is perilously close to parse(paste(...)) and we know what Thomas said about that (see fortune(parse)). A safer way of constructing a formula from names stored in a

Re: [R] Upgraded FC4 to FC5 - unable to start device X11 in R

2007-06-16 Thread Prof Brian Ripley
Clearly X11() was found, so grDevices must be on the search path. This error message is about X11 fonts. It is allowed to exclude grDevices from the list of default packages, and if you do, it is not loaded. That is a change in 2.5.0 but not a bug. If you chose not to ask for it, we presume you

Re: [R] complex contrasts and logistic regression

2007-06-16 Thread Frank E Harrell Jr
Nicholas Lewin-Koh wrote: Hi, I am doing a retrospective analysis on a cohort from a designed trial, and I am fitting the model fit-glmD(survived ~ Covariate*Therapy + confounder,myDat,X=TRUE, Y=TRUE, family=binomial()) For logistic regression you can also use Design's lrm function which

Re: [R] question about formula for lm

2007-06-16 Thread Gabor Grothendieck
A couple of easy ways are to create the calling sequence as a call or character string and then evaluate it: eval(bquote(lm(.(as.name(Ytext)) ~ Xvar, X))) eval(parse(text = paste(lm(, Ytext, ~ Xvar, X Note that these solutions both have the advantage over some of the prior solutions that

Re: [R] linear hypothesis test in gls model

2007-06-16 Thread John Fox
Dear Tine, linear.hypothesis() currently has no method specifically for gls objects, and so this usage invokes the default method. I'm not sure off-hand what's appropriate for an F-test in this context (and indeed why the default test is inappropriate). Can you describe the correct test or supply

[R] Use of the by command for gini()

2007-06-16 Thread Economics Guy
I have a data set that contains income data and a group identifier. Sort of like: DATA Group,Income A,2300 B,6776 A,6668 A,6768 B,9879 C,5577 A,7867 (etc),(etc) I am trying to compute the gini coefficient for each group. I have tried the following and none seem to do the trick: 1)

[R] data.frame and subsetting problem

2007-06-16 Thread Michelle Wynn
I have read the R online help and wiki and I cannot seem to get something to work the way I need it to. I want to create a new data frame from an subset of an existing data frame which has no reference to the original superset. If you following this example, what I am trying to do may make more

[R] GLM dist Gamma-links identity and inverse

2007-06-16 Thread laran gines
Dear users; I am doing GLMs with the Gamma distribution, and I always get errors (no valid set of coefficients: please supply starting values) or warnings (NaNs produced in log(x)) when I use the links identity or inverse, but I don´t get them if I use the log link. For example:

[R] Function for misclassification rate/type I,II error??

2007-06-16 Thread Tirthadeep
HI Is there any function in R that tells us error rate(misclassification rate) for logistic regression type classification? i also want to know the function to determine type I and type II error. I have found a link where misclass and confusion are used. But I dont know the package name.

[R] How to specify covariance matrix in copula?

2007-06-16 Thread Jiao Yang
I want to use copula package in R to generate random vector of multivariate F distribution with a pre-specified diagonal covariance matrix, say, diag(2, 3, 0, 0, 0). Can someone tell me how I can specify the diagonal covariance matrix in the copula function mvdc? Thank you very much.

[R] mardia's test

2007-06-16 Thread Jiao Yang
In the R code of Mardia's test, what does the line x1 = x[x[, p] == i, -p] mean? Thanks a lot! function (x) { p = dim(x)[2] f = p - 1 clases = length(table(x[, p])) for (i in 1:clases) { x1 = x[x[, p] == i, -p] ndat = dim(x1)[1] mo3 = mo3(x1)

[R] Status of the bs Package

2007-06-16 Thread Tom La Bone
The October 2006 R News had an article in which the authors discussed a new package that implemented the Birnbaum-Saunders distribution. However, the package (aptly named bs) does not appear to be available for installation. Does anyone know the status of this package? Thanks. Tom La Bone

Re: [R] mardia's test

2007-06-16 Thread Dirk Eddelbuettel
On 16 June 2007 at 16:50, Jiao Yang wrote: | In the R code of Mardia's test, what does the line x1 = x[x[, p] == i, -p] mean? Thanks a lot! Read it from the inside out: x[, p] == i find elements of column p in x that equal i the result is

Re: [R] data.frame and subsetting problem

2007-06-16 Thread jim holtman
Not sure what 'x2' is that you are plotting; it is not defined. read.delimand subset return dataframes, so you don't need data.frame. Here is something that does work: x - shirt,size,40 + shirt,color,10 + shirt,length,10 + shirt,brand, 1 + shoes,style,5 + shoes,brand,4 + shoes,color,1 x -

Re: [R] Define tick mark width

2007-06-16 Thread jim holtman
does this do what you want? plot(0, xlim=c(0,10), xaxt='n') axis(1, at=c(0,5,10)) axis(1,at=0:10,tcl=-.2, labels=FALSE) On 6/14/07, Sébastien [EMAIL PROTECTED] wrote: Hello, Is there a way to define the width of the axis tick marks on traditionnal plots? I did not find anything

[R] Use of the by command (clarification)

2007-06-16 Thread Economics Guy
Well apparently this has nothing to do with the gini() command. I cannot get it to work for something as simple as sum() Here is the little example I am playing with, maybe someone can help me find my error: a-c(A,B,C,A,B,C,A,A,C,B) b-c(23,6534,456,234,7,567,345,9,565,345) c-cbind(a,b) by(c,

Re: [R] data.frame and subsetting problem

2007-06-16 Thread Don MacQueen
I too have no idea what the object named x2 is, or where it came from. Particularly since after your use of subset(), the new dataframe, y, *does* include a row where V2 = 'color'. But I have a guess at what your problem may be. In your original dataframe (x) the first and second columns are

Re: [R] fSeries - Ox - ver: 240.10068 - Steps to make it work

2007-06-16 Thread Ian Gregory
I received your error now: In the function .garchOxFit the following line: write(x, file = OxSeries.csv, ncolumns = 1, append = TRUE) should be changed to: write(x = series, file = OxSeries.csv, ncolumns = 1, append = TRUE) (See below for how to reproduce this error - and identify the fix).

[R] How to comment out a piece of a R code in XEmacs+ESS

2007-06-16 Thread Ronaldo Reis Junior
Hi, When I using Xemacs+ESS to write a R code, I need to comment out a code line by line putting # It is possible to configure ESS to comment and uncomment a selected block of code. Thanks Ronaldo -- __ _ / `-' ) ,,, | | ()|||[:::e \__.-._) ''' unk -- Prof. Ronaldo

Re: [R] How to comment out a piece of a R code in XEmacs+ESS

2007-06-16 Thread Douglas Bates
On 6/16/07, Ronaldo Reis Junior [EMAIL PROTECTED] wrote: When I using Xemacs+ESS to write a R code, I need to comment out a code line by line putting # It is possible to configure ESS to comment and uncomment a selected block of code. This question probably belongs on the ESS-help mailing

Re: [R] Use of the by command (clarification)

2007-06-16 Thread Chuck Cleland
Economics Guy wrote: Well apparently this has nothing to do with the gini() command. I cannot get it to work for something as simple as sum() Here is the little example I am playing with, maybe someone can help me find my error: a-c(A,B,C,A,B,C,A,A,C,B)

Re: [R] Define tick mark width

2007-06-16 Thread Sébastien
Not really, but it is a good way to get major and minor tick marks (thanks it might be useful later in my project). What I to modify is the width of the segments which correspond to the marks? I know that I can do that with a lwd command in axis()... but there might be an option to set directly

[R] error bars on survival curve

2007-06-16 Thread Murray Pung
I am using plot(survfit(Surv(time,status) ~...) and would like to add error bars rather than the confidence intervals. Am I able to do this at specified times? e.g. when time = 20 40. leukemia.surv - survfit(Surv(time, status) ~ x, data = aml) plot(leukemia.surv, lty = 2:3,xlim = c(0,50)) #can