Re: [R] Excel

2007-08-30 Thread Austin, Matt
Ah . . . the hammer analogy. In a conversation like this it's not a question of will somebody drop it, it's when will it be dropped. --Matt Matt Austin Statistician Amgen, Inc. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Greg Snow Sent:

[R] Unexpected behavior in boxplot

2006-11-11 Thread Austin, Matt
When plotting using the cex.axis argument to boxplot(), the size of the plotting symbols beyond the whiskers of the boxplot are being changes. Example: par(mfrow=c(2,1)) boxplot(c(rnorm(10), 10), horizontal=TRUE, main=Test, las=2, cex.axis=2) boxplot(c(rnorm(10), 10), horizontal=TRUE,

Re: [R] Unexpected behavior in boxplot

2006-11-11 Thread Austin, Matt
03 svn rev39566 language R version.string R version 2.4.0 (2006-10-03) --Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Austin, Matt Sent: Saturday

Re: [R] Help with sample function

2006-06-07 Thread Austin, Matt
I couldn't help but respond to this one, it's not often I see my own name. Using data from the survival library: library(survival) lung[1:10, c('time', 'status')] Surv(lung$time, lung$status)[1:10] --Matt Matt Austin Statistician Amgen, Inc 800 9AMGEN9 x77431 805-447-7431 -Original

Re: [R] Reading SPSS .sav files

2006-04-16 Thread Austin, Matt
I don't use SPSS, so I can't help with the details. That being said, have you looked at the foreign package? --Matt Matt Austin Statistician Amgen, Inc 800 9AMGEN9 x77431 805-447-7431 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of David Kaplan Sent:

Re: [R] How can I pass a R matrix as parameter to C code?

2006-03-20 Thread Austin, Matt
You need to pass it as a vector and then you can convert to an array structure in C. Look at carray.c for one way to do this, there are others. Browse the source code and see how different authors handle your problem. Matt Austin Statistician Amgen, Inc 800 9AMGEN9 x77431 805-447-7431

Re: [R] How to add two different axis to one plot?

2006-01-29 Thread Austin, Matt
Using traditional graphics you probably want to look at ?lines, ?points, ?text . . . These allow you to add to your plot without calling new axes. For custom axes: plot(1:10, 1:10, axes=FALSE) lines(1:10, 10:1) points(1:10, runif(10, 2, 5), col=1, pch=21, bg=3, cex=3) axis(1, at=1:10) axis(3,

Re: [R] question about system command

2006-01-25 Thread Austin, Matt
Something like this. See ?formatC, ?paste for (i in 1:100) { system(paste(C:\\Progra~1\\DOSPROGRAM\\RUN.exe input, formatC(i, digits=2, flag='0'), '.dat', sep='')) } --Matt Statistician Amgen, Inc -Original Message- From:

Re: [R] multiple lowess line in one plot

2006-01-04 Thread Austin, Matt
Try using the panel.plsmo function in Dr. Harrell's Hmisc package. xyplot(AWGT ~ lipid, groups = var_name, panel=panel.plsmo) --Matt Matt Austin Statistician Amgen, Inc. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Dean Sonneborn Sent: Wednesday,

Re: [R] How do I edit the x-axis on a time series plot?

2005-12-21 Thread Austin, Matt
Phil, Does the following do what you want? plot(RecfS, ylab = 'Temperature (deg C)', xlab = 'Year', main = 'Average air temperature (deg C) at Recife, Brazil, in successive months from 1953 to 1962', adj = 0.5, axes=FALSE) axis(1, at=1952:1962, label=paste(Jan, 52:62),

Re: [R] Impaired boxplot functionality - mean instead of median

2005-12-01 Thread Austin, Matt
Check your syntax on the bwplot call. fa - data.frame(doz=sample(500:2000, size=500), fabp2=rep(1:20, 25)) bwplot(factor(fabp2) ~ doz, data=fa, panel=panel.bpplot) fa.sum - summarize( fa$doz, list( fabp2 = fa$fabp2), smean.sd, stat.name=doz) Dotplot( factor(fabp2) ~ Cbind(doz, doz - SD, doz

Re: [R] floor()

2005-11-29 Thread Austin, Matt
I believe this is a FAQ. Examine: format((5.05-floor(5))*100, nsmall=16) [1] 4.9822 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Werner Bier Sent: Tuesday, November 29, 2005 3:35 PM To: r-help@stat.math.ethz.ch Subject: [R] floor()

Re: [R] rotated ylab with xyplot

2005-11-28 Thread Austin, Matt
Try library(grid) xyplot(y~x,data.frame(x=1:10,y=runif(10)), ylab=textGrob(label=my label, rot=0)) Note in the ?xyplot the xlab/ylab section points to the 'main' parameter where it defines that a list can be used, however string rotation parameters are not in the list. The helpfile notes that a

Re: [R] On survival curve scale

2005-11-20 Thread Austin, Matt
In the helpfile, look at the ymin argument to the plot method for survfit. --Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Zhaojing Gong Sent: Sunday, November 20, 2005 6:47 PM To: R-help@stat.math.ethz.ch Cc: Zhaojing Gong Subject: [R] On

Re: [R] nlme questions

2005-11-18 Thread Austin, Matt
Warning: non-expert thoughts to follow. When passing an object to a predict method, the method looks at (a copy) of the original information from the dataframe that was used in the fit. Your original data contains information on trt1 and trt2, but factor(trt1) and factor(trt2) cannot be found

Re: [R] Using pakage foreign and to import SAS file

2005-11-14 Thread Austin, Matt
If sas isn't in the path, then you might have trouble with sas.get or read.ssd. Assuming you are using windows, go to the Start menu, select run and type sas. If sas fires up it's in your path, if not then that is the reason. --Matt -Original Message- From: [EMAIL PROTECTED]

Re: [R] ltext - adding text to each panel from a matrix

2005-11-10 Thread Austin, Matt
Haven't checked it too carefully, but how about: bwplot(treatment~foo|group, data = dat, panel=function(x,y,...) { panel.violin(x,y, ..., col = transparent, varwidth = F) gt0 - table( x 0, y) panel.abline(v=0, lty = dotted)

Re: [R] Use of paste with apply()

2005-11-06 Thread Austin, Matt
The apply function is passing each row of you matrix as a single vector into paste. If paste receives a single vector and collapse is NULL, it will simply coerce the vector into a character vector. However, when you collapse instead of sep test - matrix( as.character(1:4), 2) apply(test, 1,

Re: [R] Still a bug with NA in sd() or var()?

2005-10-31 Thread Austin, Matt
The behavior is actually documented in the var() help file (?var), although it's not clear that this would be the behavior if you just read ?sd. sd() does call var if you look at the code, so the behavior should not be unexpected. --Matt -Original Message- From: [EMAIL PROTECTED]

Re: [R] why does glm.predict give values over 1 ?

2005-10-31 Thread Austin, Matt
If you left the type argument to the predict method then your predictions are on the log-odds scale. Try using the type='response' in the predict method for glm. --Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Rohit Singh Sent: Monday, October

Re: [R] adding error bars to lattice plots

2005-10-20 Thread Austin, Matt
Have you looked at xYplot and panel.xYplot from Dr. Harrell's Hmisc package? --Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Mario Aigner-Torres Sent: Thursday, October 20, 2005 9:52 AM To: Berton Gunter; r-help@stat.math.ethz.ch Subject: Re:

Re: [R] what OS

2005-09-13 Thread Austin, Matt
.Platform$OS.type -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Omar Lakkis Sent: Tuesday, September 13, 2005 11:30 AM To: r-help@stat.math.ethz.ch Subject: [R] what OS How can I determine whT OS I am running under? if WINDOWS do this if

Re: [R] Plot of multiple data sets

2005-09-09 Thread Austin, Matt
The book is out--I received mine a few weeks ago. It is very useful. --Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Chris Buddenhagen Sent: Friday, September 09, 2005 6:30 AM To: r-help@stat.math.ethz.ch Subject: Re: [R] Plot of multiple

RE: [R] lme How to validate a model with a validation set and a t est set

2005-05-11 Thread Austin, Matt
If you used all 28 animals to find the model out of a group of candidate models, I would have my reservations about this 'validation'. Any confidence intervals you get from the final model are bound to be overly optimistic because you haven't accounted for the degrees of freedom chewed up during

RE: [R] Help with MERGE gratefully accepted

2005-04-14 Thread Austin, Matt
dat1 - data.frame(var1=c(140, 151, 167), var2=c(30.1, 11.4, 40)) dat2 - data.frame(var1=c(140, 167), var3=c(5.7, 30.3)) merge(dat1, dat2, all=TRUE) var1 var2 var3 1 140 30.1 5.7 2 151 11.4 NA 3 167 40.0 30.3 Matt Austin Statistician Amgen One Amgen Center Drive M/S 24-2-C Thousand

RE: [R] One mixed effects model for two variables

2005-03-07 Thread Austin, Matt
Here are two possibilities, but neither tests simultaneously--others may have those suggestions. 1. If one of the variables in clinically more important than the other, consider a stepdown procedure where the more important is tested first, then if the first is successful the second is tested.

RE: [R] Passing colnames to graphics title

2005-02-16 Thread Austin, Matt
If i is 1:20, there are no column names. Make sure you are indexing the names from your your dataframe. xx - data.frame(a=c(1:10), b = letters[1:10]) colnames(xx) [1] a b for(i in 1:2) print(colnames(xx)[i]) [1] a [1] b for(i in colnames(xx)) print(i) [1] a [1] b Matt Austin Statistician

RE: [R] no. at risk in survfit()

2005-02-04 Thread Austin, Matt
Have you looked at the times argument to the summary method? --Matt Matt Austin Statistician Amgen One Amgen Center Drive M/S 24-2-C Thousand Oaks CA 93021 (805) 447 - 7431 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of array chip Sent: Friday,

RE: [R] PBIB datataset

2004-12-19 Thread Austin, Matt
Is it the PBIB dataset in the SASmixed package? I don't have my copy of the text at home. --Matt library(SASmixed) Loading required package: lme4 Attaching package 'lme4': The following object(s) are masked from package:nlme : Alfalfa Assay bdf BodyWeight Cefamandole

RE: [R] SAS or R software

2004-12-17 Thread Austin, Matt
One point that is missing in this discussion is ease of review by the statistician at the FDA. As a statistician in clinical trials, you want to make it as easy as possible for your colleague at the FDA to do their job, so you put the programs in a format that they are more likely to find useful.

RE: [R] The survival rate at a certain time

2004-12-06 Thread Austin, Matt
You can use the summary method for a survfit object from the package survival as in the following example: library(survival) summary( survfit( Surv(futime, fustat)~rx,data=ovarian), times=500) Call: survfit(formula = Surv(futime, fustat) ~ rx, data = ovarian) rx=1 time

RE: [R] Response Surface

2004-11-25 Thread Austin, Matt
wireframe() is available in the package lattice. --Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED] Sent: Thursday, November 25, 2004 20:36 PM To: [EMAIL PROTECTED] Subject: [R] Response Surface Hi. I'm a student at Simon

RE: [R] scatterplot of 100000 points and pdf file format

2004-11-24 Thread Austin, Matt
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED] Sent: Wednesday, November 24, 2004 16:37 PM To: R Help Mailing List Subject: RE: [R] scatterplot of 10 points and pdf file format On 24-Nov-04 Prof Brian Ripley wrote: On

RE: [R] Error in anova(): objects must inherit from classes

2004-11-24 Thread Austin, Matt
The lme method for anova() checks the inheritance of the object when a single object is supplied, which is why there is no error when you use one object at a time. When two objects are supplied, the method uses the class of the object by invoking the data.class function (which does not list

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

2004-11-09 Thread Austin, Matt
The following works, you need to include x=TRUE in the call to coxph. Passing the time and status variables as additional arguments is a matter of personal preference. f.coxph.zph-function(x, timeVar, statusVar) { cox.fit - coxph(Surv(timeVar, statusVar) ~ x, na.action = na.exclude,

RE: [R] List seems to drop empty levels of factors when containin g them

2004-11-09 Thread Austin, Matt
I don't get the same result, do you have a package loaded that would change the default behavior (such as Hmisc)? list(grp.1) [[1]] [1] 1 2 Levels: 1 2 list(grp.1[mask]) [[1]] [1] 1 Levels: 1 2 library(Hmisc) snip list(grp.1[mask]) [[1]] [1] 1 Levels: 1 --Matt version _

RE: [R] lag variable addition to data frame question

2004-10-29 Thread Austin, Matt
?diff --Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of s viswanath Sent: Friday, October 29, 2004 7:22 AM To: [EMAIL PROTECTED] Subject: [R] lag variable addition to data frame question Hi, I was wondering if there is a more efficient way of

RE: [R] Secondary y axis

2004-10-26 Thread Austin, Matt
You could replace your last two lines with the following. You'll need to play with the axes labeling to make it pretty. scaled.c - scale(c) par(new=TRUE) plot(scaled.c, ylim=c(-5, 5), xaxt=n, yaxt=n, col='green', type='l', xlab=, ylab=) axis (4, labels=round(seq(-2, 2, .25)*attr(scaled.c,

RE: ??: [R] R plot problems

2004-10-17 Thread Austin, Matt
The following should work, note I made x.name a factor. x - data.frame(main.name=AAA, x.name=factor(rep(c(Apply,Watermelon,Lemon,Banana, Grape,Pineapply,Cherry,Peach,Orange,Mango,Strawberry),each=5)) , y.name=(1:55)) plot(x$x.name, x$y.name, axes=FALSE)

RE: [R] incomplete function output

2004-10-13 Thread Austin, Matt
I would return the values from the various tests in a list. If you only want them to print and not for use in other parts of your program you could explicitly print each test using print(). root - function(var) { #---Phillips-Perron test1 - PP.test(var, lshort = TRUE) test2 - PP.test(var,

RE: [R] covariate selection?

2004-10-12 Thread Austin, Matt
I like Kjetil's suggestion of a shrinkage estimator. Perhaps this would be a good time to experiment with Trevor Hastie's 'lars' package. If you have a lot of correlated inputs I might suggest using Andy Liaw's randomforest package. I have found this technique to be very valuable in this

RE: followup: Re: [R] Issue with predict() for glm models

2004-09-23 Thread Austin, Matt
Could you just use lines(newX, myPred, col=2) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Paul Johnson Sent: Thursday, September 23, 2004 10:3 AM To: r help Subject: followup: Re: [R] Issue with predict() for glm models I have a follow up question

RE: [R] unable to download

2004-09-20 Thread Austin, Matt
You may need to supply some additional information about your setup. What operating system and version are you using? How are you connecting to the internet? Can you download packages from other sources (such as CRAN)? Exactly what procedure are you using to download the packages? Have you

RE: [R] how to take this experiment with R?

2004-09-20 Thread Austin, Matt
My mistake, you can't use the structure I proposed with lm() in combination with step(). If what was suggested earlier by Gabor was not what you wanted, and instead you want the 'best' three variable model, then it may be easier to use the leaps package. library(leaps) x -

RE: [R] Printing output on Plot

2004-09-02 Thread Austin, Matt
The following example should get you started. library(survival) test1 - list(time= c(4, 3,1,1,2,2,3), status=c(1,NA,1,0,1,1,0), x= c(0, 2,1,1,1,0,0), sex= c(0, 0,0,0,1,1,1)) cpfit - coxph( Surv(time, status) ~ x + strata(sex), test1)

RE: [R] (no subject)

2004-08-30 Thread Austin, Matt
You need to use a device to print to such as postscript(file=/where/to/put/file/filename.ps) ##your plotting code here dev.off() Writing a plot at each iteration of your simulation can impact the runtime greatly. Please read the posting guide at the bottom of the e-mail, it can help

RE: [R] (no subject)

2004-08-30 Thread Austin, Matt
Of Austin, Matt Sent: Monday, August 30, 2004 18:56 PM To: 'Loke Chok Kang'; [EMAIL PROTECTED] Subject: RE: [R] (no subject) You need to use a device to print to such as postscript(file=/where/to/put/file/filename.ps) ##your plotting code here dev.off() Writing a plot at each iteration

RE: [R] column names in data.frame

2004-08-19 Thread Austin, Matt
Note that split() creates a list with each component named by the year. When you use the sapply function the names are retained in the attribute names, you can print this out to see or use str() or look at the output from the attribute() function. Your division also maintains the names and then

RE: [R] calibration/validation sets

2004-08-14 Thread Austin, Matt
You could keep a row index vector like in the following example. data(iris) indx - sample(nrow(iris), 20, replace=FALSE) train - iris[indx,] test - iris[-indx,] --Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Peyuco Porras Porras . Sent:

RE: [R] Private methods

2004-08-13 Thread Austin, Matt
.class1 is an 'internal' method in the namespace of the package 'methods'. It can be accessed with the ::: operator. A good start for documentation may be Vol 3/1 of R-News. methods:::.class1 function (x) class(x)[[1]] environment: namespace:methods --Matt -Original Message- From:

RE: [R] How to put multiple plots in the same window? (not par(mf row=))

2004-07-30 Thread Austin, Matt
Lattice graphics may be the answer depending on your exact problem. Here is an example of four traditional plots without space: par(mfrow=c(2,2), omi=c(.5, .5, .5, .5)) par(mar=c(0, 2, 2, 0)) plot(rnorm(10), rnorm(10), axes=FALSE) box(); axis(2); axis(3) par(mar=c(0, 0, 2, 2))

RE: [R] Problem with bwplot

2004-07-09 Thread Austin, Matt
Try factor(vec2) in your bwplot() call. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Ernesto Jardim Sent: Friday, July 09, 2004 9:41 AM To: Mailing List R Subject: [R] Problem with bwplot Hi, I'm ploting some box-and-whisker plots with bwplot but I'm

RE: [R] funny plotting

2004-06-29 Thread Austin, Matt
Try something like plot(x,y) box.dat - boxplot(x=split(counts, dial), plot=FALSE) bxp(box.dat, add=TRUE, at=c(-1, 0, 1), show.names=FALSE) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Karla Meurk Sent: Tuesday, June 29, 2004 21:46 PM To: [EMAIL

RE: [R] function for running MS-DOS on R

2004-05-20 Thread Austin, Matt
Perhaps you could use the R2WinBugs package? --Matt -Original Message- From: [EMAIL PROTECTED] [mailto:r-help- [EMAIL PROTECTED] Behalf Of bang jeong sook Sent: Thursday, May 20, 2004 19:9 PM To: [EMAIL PROTECTED] Subject: [R] function for running MS-DOS on R I had downloaded the

RE: [R] question

2004-02-27 Thread Austin, Matt
You want to use instead of . --Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Svetlana Eden Sent: Friday, February 27, 2004 7:57 AM To: r-help Subject: [R] question Hi everybody. The question: I get two vectors 'iFalseFalse' and 'i2'. I think they