Re: [R] drc results differ for different versions

2009-05-22 Thread Hans Vermeiren
Hello Thanks a lot Marc, for the suggestion to explore the issue a bit more systematically So I did and the conclusion is that with the old drc 1.4-2, I get a SE=0.003, with the new drc 1.5-2, I get a SE=0.4 irrespective of the R version or the version of the packages drc depends on I hope

Re: [R] arrangement of crowded labels

2009-05-22 Thread Jim Lemon
Thomas Zumbrunn wrote: ... Thanks for your answers. This was almost what I was looking for, except that I would need something for a 2-dimensional context (my question was not specific enough). Hi Thomas, The thigmophobe.labels function just works out how to place each label away from the

[R] Confirmatory factor analysis problems using sem package (works in Amos)

2009-05-22 Thread S. Messing
Hello all, I'm trying to replicate a confirmatory factor analysis done in Amos. The idea is to compare a one-factor and a two-factor model. I get the following warning message when I run either model: Could not compute QR decomposition of Hessian. Optimization probably did not converge. I

[R] Goodness of fit in quantile regression

2009-05-22 Thread laura m.
Dear R users, I've used the function qr.fit.sfn to estimate a quantile regression on a panel data set. Now I would like to compute an statistic to measure the goodness of fit of this model. Does someone know how could I do that? I could compute a pseudo R2 but in order to do that I would need

Re: [R] drc results differ for different versions

2009-05-22 Thread Christian Ritz
Hi Hans, I hope I can resolve your problems below (Marc, thank you very much for cc'ing me on your initial response!). Have a look at the following R lines: ## Fitting the model using drm() (from the latest version) m1- drm(response ~ dose, data = d, fct = LL.4()) summary(m1) plot(m1) ##

[R] likelihood

2009-05-22 Thread Mark Bilton
I have a problem related to measuring likelihood between -an observed presence absence dataset (containing 0 or 1) -a predicted simulation matrix of the same dimensions (containing values from 0 to 1) This must be a common problem but I am struggling to find the answer in the literature.

Re: [R] Behavior of seq with vector from

2009-05-22 Thread baptiste auguie
Hi, Perhaps you can try this, seq.weave - function(froms, by, length, ... ){ c( matrix(c(sapply(froms, seq, by=by, length = length/2, ...)), nrow=length(froms), byrow=T) ) } seq.weave(c(2, 3), by=3, length=8) seq.weave(c(2, 3, 4),

Re: [R] System crash when using surv=T in cph

2009-05-22 Thread Uwe Ligges
maxb wrote: Can someone help me. I am very new to R. I am fitting a Cox model using Frank Harrell's cph as I want to produce a Nomogram. This is what I have done: Srv- Surv(time,cens) f.cox- cph(Srv~ v1+v2+v3+v4, x=T, y=T, surv=T) This is not reproducible for us. Where are the data? What is

Re: [R] Paste Strings as logical for functions?

2009-05-22 Thread Uwe Ligges
tsunhin wong wrote: Dear R Users, I have some dynamic selection rules that I want to pass around for my functions: rules - paste(g$TrialList==1 g$Session==2) I guess you do not want to paste() at all: rules - g$TrialList==1 g$Session==2 Uwe Ligges myfunction - function(rules) {

Re: [R] step by step debugger in R?

2009-05-22 Thread Uwe Ligges
Michael wrote: Could anybody point me to the latest status of the most user-friendly debugger in R? I always have been happy with ?debug, ?recover and friends cited there. Although you also find additional software like the debug package .. Best, Uwe Ligges How I wish I don't have to

Re: [R] drc results differ for different versions

2009-05-22 Thread Hans Vermeiren
Yes, thanks that's very useful Apart from checking the fit with nls() as you suggested, I've also used Prism, which gave the following results Equation 1 Best-fit values BOTTOM 10.96 TOP106.4 LOGEC50-5.897 HILLSLOPE 0.9501 EC50 1.2670e-006

Re: [R] Behavior of seq with vector from

2009-05-22 Thread Peter Dalgaard
Rowe, Brian Lee Yung (Portfolio Analytics) wrote: To get the value I want, I am using the following code: sort(as.vector(apply(array(c(2,3)), 1, seq, by=3,length.out=4))) [1] 2 3 5 6 8 9 11 12 So two questions: 1. Is seq designed/intended to be used with a vector from argument,

Re: [R] drc results differ for different versions

2009-05-22 Thread Christian Ritz
Yes, you're right: taking logarithms is no longer needed! Christian __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented,

[R] anova leads to an error

2009-05-22 Thread Skotara
Dear R-list, the following code had been running well over the last months: exam - matrix(rnorm(100,0,1), 10, 10) gg - factor(c(rep(A, 5), rep(B, 5))) mlmfit - lm(exam ~ 1); mlmfitG - lm(exam ~ gg) result - anova(mlmfitG, mlmfit, X=~0, M=~1) Until, all of a sudden the

[R] Changing a legend title to bold font

2009-05-22 Thread Steve Murray
Dear all, I have seen a response from Duncan Murdoch which comes close to solving this one, but I can't quite seem to tailor it to fit my needs! I am trying to make just the title in my legend as bold font, with the legend 'items' in normal typeface. I've tried setting par(font=2) external

[R] Cannot Install Cairo Library

2009-05-22 Thread Lorenzo Isella
Dear All, I am running Debian testing on my box and I have R 2.9.0 installed from the standard repositories. I downloaded the package source from http://cran.r-project.org/web/packages/Cairo/index.html but when I try to install it on my system, this is what I get $ sudo R CMD INSTALL

Re: [R] Cannot Install Cairo Library

2009-05-22 Thread Dirk Eddelbuettel
On 22 May 2009 at 13:42, Lorenzo Isella wrote: | Dear All, | I am running Debian testing on my box and I have R 2.9.0 installed from | the standard repositories. | I downloaded the package source from | http://cran.r-project.org/web/packages/Cairo/index.html | but when I try to install it on my

Re: [R] Cannot Install Cairo Library

2009-05-22 Thread Lorenzo Isella
Dirk Eddelbuettel wrote: On 22 May 2009 at 13:42, Lorenzo Isella wrote: | Dear All, | I am running Debian testing on my box and I have R 2.9.0 installed from | the standard repositories. | I downloaded the package source from | http://cran.r-project.org/web/packages/Cairo/index.html | but

[R] Reading iputs from adjacency matrix

2009-05-22 Thread pankaj borah
Dear all , I am just wondering if there is a way to read inputs from adjacency matrix . I am using igraph module. I want to directly load the input as adjacency instead of reading as edgelist or pajek format. Can anypne help ? Thanks , Pankaj Barah Mathematical modelling Computational

Re: [R] Need a faster function to replace missing data

2009-05-22 Thread Dieter Menneq
Tim Clark mudiver1200 at yahoo.com writes: I need some help in coming up with a function that will take two data sets, determine if a value is missing in one, find a value in the second that was taken at about the same time, and substitute the second value in for where the first should have

[R] Step by step: Making an R package with Fortran 95

2009-05-22 Thread sjnovick
To all. I need your help. The big question is: How do I make an R library with Fortran 95 files? You may assume that I am a pretty decent programmer in both R and Fortran. I lay out a scenario and need your help! I know how to make an ordinary R package and have dabbled with R + Fortran 95

[R] How to compute the score-statistics from a logistic model using lrm {Design}

2009-05-22 Thread Christian Ametz
Greetings, is there are way to simply compute the score-statistics for a logistic model generated with lrm? For example, I want to compare the wald-statistics for a given model against the score-statistics in order to find the relevant predictors. attach(iris) model = lrm

Re: [R] Confirmatory factor analysis problems using sem package (works in Amos)

2009-05-22 Thread John Fox
Dear Solomon, -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of S. Messing Sent: May-22-09 1:27 AM To: r-help@r-project.org Subject: [R] Confirmatory factor analysis problems using sem package (works in Amos) Hello all,

Re: [R] survfit, summary, and survmean (was Changelog for survival package)

2009-05-22 Thread Terry Therneau
Further I appreciate your new function survmean(). At the moment it seems to be intended as internal, and not documented in the help. The computations done by print.survfit are now a part of the results returned by summary.survfit. See 'table' in the output list of ?summary.survfit.

Re: [R] System crash when using surv=T in cph

2009-05-22 Thread Frank E Harrell Jr
maxb wrote: Can someone help me. I am very new to R. I am fitting a Cox model using Frank Harrell's cph as I want to produce a Nomogram. This is what I have done: Srv- Surv(time,cens) f.cox- cph(Srv~ v1+v2+v3+v4, x=T, y=T, surv=T) As soon as I press enter, Windows XP crashes. If I remove

Re: [R] Class for time of day?

2009-05-22 Thread Stavros Macrakis
On Thu, May 21, 2009 at 8:28 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: It uses hours/minutes/seconds for values 1 day and uses days and fractions of a day otherwise. Yes, my examples were documenting this idiosyncracy. For values and operations that it has not considered it

Re: [R] postscript problems (landscape orientation)

2009-05-22 Thread Marc Schwartz
On May 21, 2009, at 6:31 PM, Ted Harding wrote: On 21-May-09 23:02:28, David Scott wrote: Well most people deal with that problem by not using Acrobat to read .pdf files. On linux you can use evince or xpdf. On windows just use gsview32. Those readers don't lock the .pdf. I am with Peter and

Re: [R] Step by step: Making an R package with Fortran 95

2009-05-22 Thread Duncan Murdoch
On 5/22/2009 8:18 AM, sjnovick wrote: To all. I need your help. The big question is: How do I make an R library with Fortran 95 files? You may assume that I am a pretty decent programmer in both R and Fortran. I lay out a scenario and need your help! I know how to make an ordinary R

[R] Query regarding na.omit function

2009-05-22 Thread Moumita Das
Hi friends, I have a query regarding na.omit function.Please ,someone help me. I have a function xyz_function-function(arguments) { some code return(list(matrix=dataset)) } xyz_function_returnvalue-xyz_function(passed argumentss) *Case-I*

[R] Forcing a variableinto a model using stepAIC

2009-05-22 Thread Laura Bonnett
Dear All, I am attempting to use forward and/or backward selection to determine the best model for the variables I have. Unfortunately, because I am dealing with patients and every patient is receiving treatment I need to force the variable for treatment into the model. Is there a way to do

Re: [R] Query regarding na.omit function

2009-05-22 Thread jim holtman
PLEASE do read the posting guide http://www.R-project.org/posting-guide.htmlhttp://www.r-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. We have no idea of the structure of 'dataset' that is being returned by your function. This example works

Re: [R] Class for time of day?

2009-05-22 Thread Gabor Grothendieck
You could create a subclass of times with its own print and format methods that printed and formatted hours/minutes/seconds even if greater than one day if that is the main item you need. Regarding division you could contribute that to the chron package. I've contributed a few missing items and

Re: [R] Forcing a variableinto a model using stepAIC

2009-05-22 Thread Chuck Cleland
On 5/22/2009 9:58 AM, Laura Bonnett wrote: Dear All, I am attempting to use forward and/or backward selection to determine the best model for the variables I have. Unfortunately, because I am dealing with patients and every patient is receiving treatment I need to force the variable for

Re: [R] Query regarding na.omit function

2009-05-22 Thread Moumita Das
Hi Jim, xyz_function-function(arguments) { some code pair_raw_data-changeMissingValuestoNA(pair_raw_data$matrix,pair_raw_data$dim,missing_values) return(list(matrix=pair_raw_data)) } Type of my dataset was a list.I tried checking that ,changing my dataset to some other

[R] EM algorithm mixture of multivariate gaussian

2009-05-22 Thread daniele riggi
Hi, i would to know, if someone have ever write the code to estimate the parameter (mixing proportion, mean, a var/cov matrix) of a mixture of two multivariate normal distribution. I wrote it and it works (it could find mean and mixing proportion, if I fix the var/cov matrix), while if I fix

[R] bug in rpart?

2009-05-22 Thread Yuanyuan
Greetings, I checked the Indian diabetes data again and get one tree for the data with reordered columns and another tree for the original data. I compared these two trees, the split points for these two trees are exactly the same but the fitted classes are not the same for some cases. And the

[R] Returning only a file path on Windows

2009-05-22 Thread amvds
I am choosing a file like this: #Bring up file selection box fn-file.choose() fp-file.path(fn,fsep='\\') Unfortunately, the file path contains the short file name and extension as well. I had hoped to get only the path so I could make my own long filenames (for output graphs) by concatenation

Re: [R] Behavior of seq with vector from

2009-05-22 Thread Rowe, Brian Lee Yung (Portfolio Analytics)
So if I want to concatenate the output of multiple seq calls, there's no clear way to to do this? For background, I have a number of data.frames with the same structure in a list. I want to 'collapse' the list into a single data.frame but only keeping certain columns from each underlying

[R] fitting Autoregressive Conditional Duration and Cox Proportional Hazard model in R

2009-05-22 Thread Michael
Hi all, Could anybody point me to some existing code in R for fitting Autoregressive Conditional Duration and Cox proportional hazard model and with model selection and model specification tests? Thank you! __ R-help@r-project.org mailing list

Re: [R] step by step debugger in R?

2009-05-22 Thread Michael
Really I think if there is a Visual Studio strength debugger, our collective time spent in developing R code will be greatly reduced. 2009/5/22 Uwe Ligges lig...@statistik.tu-dortmund.de: Michael wrote: Could anybody point me to the latest status of the most user-friendly debugger in R?

[R] EM algorithm mixture of multivariate

2009-05-22 Thread daniele riggi
Hi, i would to know, if someone have ever write the code to estimate the parameter (mixing proportion, mean, a var/cov matrix) of a mixture of two multivariate normal distribution. I wrote it and it works (it could find mean and mixing proportion, if I fix the var/cov matrix), while if I fix

[R] axis(): disable prevention of overlapping tick labels for pgfSweave()

2009-05-22 Thread Gerhard Schön
Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit Dear R Users, I'm using pgfSweave() form R-Forge. How can I disable prevention of overlapping tick labels in axis()? If I use axis() with Sweave(Test1, driver = pgfSweaveDriver), R treats the

Re: [R] Class for time of day?

2009-05-22 Thread Stavros Macrakis
On Fri, May 22, 2009 at 10:03 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: Regarding division you could contribute that to the chron package. I've contributed a few missing items and they were incorporated. Good to know. Maybe I'll do that Giving an error when it does not

Re: [R] anova leads to an error

2009-05-22 Thread Peter Dalgaard
Skotara wrote: Dear R-list, the following code had been running well over the last months: exam - matrix(rnorm(100,0,1), 10, 10) gg - factor(c(rep(A, 5), rep(B, 5))) mlmfit - lm(exam ~ 1); mlmfitG - lm(exam ~ gg) result - anova(mlmfitG, mlmfit, X=~0, M=~1)

Re: [R] Returning only a file path on Windows

2009-05-22 Thread Duncan Murdoch
On 5/22/2009 10:45 AM, am...@xs4all.nl wrote: I am choosing a file like this: #Bring up file selection box fn-file.choose() fp-file.path(fn,fsep='\\') file.path() constructs a path from component parts, it doesn't extract the path from a filename. You want dirname(fn). You may also want

Re: [R] Behavior of seq with vector from

2009-05-22 Thread Gabor Grothendieck
Try it this way: # test list of data frames L - list(anscombe[1:4], anscombe[5:8], anscombe[1:4], anscombe[5:8]) # get columns 2 and 3 from each component; cbind those together do.call(cbind, lapply(L, [, 2:3)) On Fri, May 22, 2009 at 11:01 AM, Rowe, Brian Lee Yung (Portfolio Analytics)

Re: [R] Returning only a file path on Windows

2009-05-22 Thread Uwe Ligges
Are you looking for choose.dir() ? Or basename() and dirname()? Uwe Ligges am...@xs4all.nl wrote: I am choosing a file like this: #Bring up file selection box fn-file.choose() fp-file.path(fn,fsep='\\') Unfortunately, the file path contains the short file name and extension as well. I had

Re: [R] step by step debugger in R?

2009-05-22 Thread Duncan Murdoch
On 5/22/2009 10:59 AM, Michael wrote: Really I think if there is a Visual Studio strength debugger, our collective time spent in developing R code will be greatly reduced. If someone who knows how to write a debugger plugin for Eclipse wants to help, we could have that fairly easily. All the

Re: [R] survfit, summary, and survmean (was Changelog for survival package)

2009-05-22 Thread Heinz Tuechler
Dear Terry, sorry that I did not see this change, and thank you for it. It is very useful. Heinz At 15:28 22.05.2009, Terry Therneau wrote: Further I appreciate your new function survmean(). At the moment it seems to be intended as internal, and not documented in the help. The

Re: [R] Behavior of seq with vector from

2009-05-22 Thread Bert Gunter
##Is this what you mean ?? do.call(rbind,lapply(yourlist,[,,seq(from=1,by=3,length=4))) ## note the ,, that omits the row argument in the call to [ -- Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org

Re: [R] Behavior of seq with vector from

2009-05-22 Thread jim holtman
Yet another way of doing it: x - c(2,3) x + rep(seq(0, by=3, length=4), each=length(x)) [1] 2 3 5 6 8 9 11 12 On Fri, May 22, 2009 at 11:01 AM, Rowe, Brian Lee Yung (Portfolio Analytics) b_r...@ml.com wrote: So if I want to concatenate the output of multiple seq calls, there's no

[R] levelplot in combination with xyplot

2009-05-22 Thread Eelke Folmer
With levelplot I would like to combine fitted values and raw values in one plot. The surface should be based on fitted values and on top of those I would like distinguisable points based on the raw data with a colorscheme the same as the surface. # raw data x1 = rep(1:10, times = 10) x2 =

Re: [R] Behavior of seq with vector from

2009-05-22 Thread Rowe, Brian Lee Yung (Portfolio Analytics)
Brilliant! Thanks, Brian -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: Friday, May 22, 2009 11:20 AM To: Rowe, Brian Lee Yung (Portfolio Analytics) Cc: Peter Dalgaard; r-help@r-project.org Subject: Re: [R] Behavior of seq with vector from Try it

Re: [R] Axis Limits in Scatterplot3d

2009-05-22 Thread Uwe Ligges
Alan wrote: Hi, How do you obtain the limits of the plotting region in a scatterplot3d plot? `par('usr')' does not seem to give sensible values, and that vector only has 4 elements (not the expected 6). Well, I never designed anything to do that, but it is possible with the following

[R] lattice strip argument check

2009-05-22 Thread Sebastien Bihorel
Dear R-Users, Is there a way to check within the following dummy function if the strip argument is different from the default set in the function declaration? FYI, this argument should be used downstream in a xyplot call of my actual function. dummyfunction - function(..., strip =

Re: [R] Class for time of day?

2009-05-22 Thread Gabor Grothendieck
On Fri, May 22, 2009 at 11:01 AM, Stavros Macrakis macra...@alum.mit.edu wrote: On Fri, May 22, 2009 at 10:03 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: Regarding division you could contribute that to the chron package. I've contributed a few missing items and they were

Re: [R] good numerical optimization to use in R?

2009-05-22 Thread spencerg
Have you tried the maxLik package? If that is not adequate, you can check CRAN Task View: Optimization and Mathematical Programming (http://cran.fhcrc.org/web/views/Optimization.html). Or try the new RSiteSearch.function in the RSiteSearch package. If none of these adequate, please

[R] Error in FUN with tapply and by

2009-05-22 Thread Thomas Levine
A subset of my raw data looks like this: -- Grip Technique Baseline.integrated Task Stroke..direction.Engag Disen PenDG PenUG PenDS PenUS Duration -

[R] sciplot question

2009-05-22 Thread Jarle Bjørgeengen
Hi, I would like to have lineplot.CI and barplot.CI to actually plot confidence intervals , instead of standard error. I understand I have to use the ci.fun option, but I'm not quite sure how. Like this : qt(0.975,df=n-1)*s/sqrt(n) but how can I apply it to visualize the length of

[R] regrouping factor levels

2009-05-22 Thread ravi
Hi all, I had some trouble in regrouping factor levels for a variable. After some experiments, I have figured out how I can recode to modify the factor levels. I would now like some help to understand why some methods work and others don't. Here's my code : rm(list=ls()) ###some trials in

Re: [R] Goodness of fit in quantile regression

2009-05-22 Thread Brian S Cade
Laura: Part of the issue may depend on what you mean by goodness-of-ft. If you are looking for some global measure like a pseudo R or AIC to select among models, you ought to be able to make those calculations off the objective function that was minimized as you recognized. If qr.fit.sfn()

Re: [R] Error in FUN with tapply and by

2009-05-22 Thread jim holtman
Error message is self-explanatory: there is an unused parameter 'na.rm=TRUE'. You are calling your function 'truecost' which only has a single parameter 'time' and you are attempting to pass in 'na.rm=TRUE' which it will not accept. You don't need it. On Fri, May 22, 2009 at 12:36 PM, Thomas

Re: [R] Need a faster function to replace missing data

2009-05-22 Thread William Dunlap
Here are 2 functions, which.just.above and which.just.below, which may help you. They will tell which element in a reference dataset is the first just above (or just below) each element in the main dataset (x). They return NA if there is no reference element above (or below) an element of x.

Re: [R] Need a faster function to replace missing data

2009-05-22 Thread jim holtman
I think this does what you want. It uses 'findInterval' to determine where a possible match is: myvscan-data.frame(c(1,NA,1.5),as.POSIXct(c(12:00:00,12:14:00,12:20:00), format=%H:%M:%S)) # convert to numeric names(myvscan)-c(Latitude,DateTime) myvscan$tn - as.numeric(myvscan$DateTime) #

Re: [R] step by step debugger in R?

2009-05-22 Thread Romain Francois
Duncan Murdoch wrote: On 5/22/2009 10:59 AM, Michael wrote: Really I think if there is a Visual Studio strength debugger, our collective time spent in developing R code will be greatly reduced. If someone who knows how to write a debugger plugin for Eclipse wants to help, we could have that

Re: [R] bug in rpart?

2009-05-22 Thread Uwe Ligges
Yuanyuan wrote: Greetings, I checked the Indian diabetes data again and get one tree for the data with reordered columns and another tree for the original data. I compared these two trees, the split points for these two trees are exactly the same but the fitted classes are not the same for

Re: [R] Class for time of day?

2009-05-22 Thread Stavros Macrakis
On Fri, May 22, 2009 at 12:28 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: ...The way this might appear in code is if someone wanted to calculate the number of one hour intervals in 18 hours. One could write: t18 - times(18:00:00) t1 - times(1:00:00) as.numeric(t18) /

Re: [R] How can I estimate a Box-Cox function with R?

2009-05-22 Thread Ikerne del Valle
Thanks Gregory. I see that that with boxcox.lm() the optimal lambda is obtained and plotted against log-likelihood. library(MASS) boxcox(Volume ~ log(Height) + log(Girth), data = trees, lambda = seq(-0.25, 0.25, length = 10)) But has how can I see the fit of the same linear model

Re: [R] Class for time of day?

2009-05-22 Thread Gabor Grothendieck
On Fri, May 22, 2009 at 1:55 PM, Stavros Macrakis macra...@alum.mit.edu wrote: On Fri, May 22, 2009 at 12:28 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: ...The way this might appear in code is if someone wanted to calculate the number of one hour intervals in 18 hours.  One could

Re: [R] Naming a random effect in lmer

2009-05-22 Thread spencerg
The first exaample on the lmer help page uses a formula Reaction ~ Days + (Days|Subject). Here, Subject is the name of a column in the data.frame sleepstudy, with levels 308, 309, ... . Does this answer your question? If no, please provide commented, minimal, self-contained,

[R] Object not found

2009-05-22 Thread Gaertner, Stefanie
Hello, I run into a problem: ftable(table(Fire, Standard, StoAll), col.vars=c(Fire,Standard)) Error in table(Fire, Standard, StoAll) : object 'Fire' not found I do not understand that because when I read the table everything seems correct.

Re: [R] Object not found

2009-05-22 Thread jim holtman
You read them into a dataframe so you need to do ftable(table(Stocking_all$Fire, Stocking_all$Standard, StoAll), col.vars=c(Fire,Standard)) On Fri, May 22, 2009 at 2:33 PM, Gaertner, Stefanie stefanie.gaert...@ales.ualberta.ca wrote: Hello, I run into a problem: ftable(table(Fire,

Re: [R] Error in FUN with tapply and by

2009-05-22 Thread Thomas Levine
str(time) function (x, ...) str(t_p1) num [1:576] 190 180 190 200 210 200 220 190 230 230 ... str(Baseline.integrated) Factor w/ 2 levels Baseline,Integrated: 1 1 1 1 1 1 1 1 1 1 ... str(Technique) Factor w/ 2 levels Barrel,NonPrefHand: 1 1 1 1 1 1 1 1 1 1 ... str(Grip) Factor w/ 2 levels

Re: [R] Barchart in lattice - wrong order of groups, data labels on top of each other, and a legend question

2009-05-22 Thread Dimitri Liakhovitski
Thank you very much, Gabor! On Thu, May 21, 2009 at 9:37 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: If you are willing to go down one level and work at the grid level then you can do it without modifying the panel function. Below gg.ls$name lists the grid object names.  Within that

Re: [R] step by step debugger in R?

2009-05-22 Thread Robert Gentleman
Hi, Romain Francois wrote: Duncan Murdoch wrote: On 5/22/2009 10:59 AM, Michael wrote: Really I think if there is a Visual Studio strength debugger, our collective time spent in developing R code will be greatly reduced. If someone who knows how to write a debugger plugin for Eclipse wants

Re: [R] step by step debugger in R?

2009-05-22 Thread John Lindsey
As a newbie I'm trying to figure out how much more than RKWard does is wanted. The code turns colors as syntax is checked and errors are noted. It seems like a reasonable IDE. Maybe someone is looking for the same in windows? John F Lindsey 803-790-5006 Home , 803-790-5008 Cell 919-439-9088

Re: [R] vcd package --- change layout of plot

2009-05-22 Thread Achim Zeileis
On Thu, 21 May 2009, Prew, Paul wrote: Hello, I'm trying to use the vcd package to analyze survey data. Expert judges ranked possible features for product packaging. Seven features were listed, and 19 judges split between 2 cities ranked them. The following code (1) works, but the

Re: [R] Naming a random effect in lmer

2009-05-22 Thread Leigh Ann Starcevich
Here is a test data set and code. I am including the data set after the code and discussion to make reading easier. Apologies for the size of the data set, but my problem occurs when there are a lot of Z variables. Thanks for your time. # Enter data below # Sample code library(lme4) mb-

[R] stripchart and ordering of plot

2009-05-22 Thread Andrew Yee
Take for example the following stripchart that's created: b - 1:5 a - 11:15 e - 21:25 f - -11:-15 foo - rbind(b,a,e,f) stripchart(foo ~ rownames(foo)) In this case, I would like the bottom part of the plot to be the f vector, followed by the e vector, etc. However, R reorders the matrix and

Re: [R] vcd package --- change layout of plot

2009-05-22 Thread Prew, Paul
Dear Achim, thank you very much for the suggestions, they work well. Agreed that an ordinal logistic regression seems a more powerful choice of analysis method, and I'm using that also. Thanks for providing the vcd package, it's proving quite helpful. Regards, Paul Paul Prew | Statistician

[R] Goodness of fit for MLE?

2009-05-22 Thread Michael
Hi all, How do I evaluate how good is my MLE fit? Moreover, suppose I am having 30 data points, and 50 points, how do I compare which one gives better goodness-of-fit? What are the common test procedures to assess the goodness of fit for MLE? Thanks!

Re: [R] Naming a random effect in lmer

2009-05-22 Thread spencerg
I miscommunicated: In every application I've seen with large numbers of parameters to estimate, most of those parameters are specific instances of different levels of a random effect. For example, a colleague recently did a fixed effects analysis of a longitudinal abundance survey of a large

[R] mle() question

2009-05-22 Thread Stephen Collins
Is there a way to code the mle() function in library stats4 such that it switches optimizing methods midstream (i.e. BFGS to Newton and back to BFGS, etc.)? Thanks, Stephen Collins, MPP | Analyst Health Benefits | Aon Consulting [[alternative HTML version deleted]]

Re: [R] Naming a random effect in lmer

2009-05-22 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of spencerg Sent: Friday, May 22, 2009 3:01 PM To: Leigh Ann Starcevich Cc: r-help@r-project.org Subject: Re: [R] Naming a random effect in lmer [ ... elided statistical advice

[R] how to insert NULLs in lists?

2009-05-22 Thread Kynn Jones
I'm an experienced programmer, but learning R is making me lose the little hair I have left... list(NULL) [[1]] NULL length(list(NULL)) [1] 1 x - list() x[[1]] - NULL x list() length(x) [1] 0 From the above experiment, it is clear that, although one can create a one-element list

Re: [R] how to insert NULLs in lists?

2009-05-22 Thread Bert Gunter
Continuing your example below, x[4] - list(NULL) I won't try to defend the semantics,which have been complained about before. However, note that with lists, x[i] is the list which consists of one member, the ith component of x, which is not the same as x[[i]], the ith component, itself; so the

Re: [R] how to insert NULLs in lists?

2009-05-22 Thread markleeds
Hi Kynn: this oddity is discussed in Patrick Burn's document called The R Inferno. I don't recall the fix so I'm not sure if below is the same as what his book says to do but it seems to do what you want. x - list() x[[1]] - 2 x length(x) print(str(x)) x[2] -

Re: [R] Need a faster function to replace missing data

2009-05-22 Thread Tim Clark
Jim, Thanks! I like the way you use indexing instead of the loops. However, the find.Interval function does not give the right result. I have been playing with it and it seems to give the closest number that is less than the one of interest. In this case, the correct replacement should

[R] rank reduction method in time series analysis?

2009-05-22 Thread Michael
Hi all, Suppose I have 100 simultaneous time series, what's the best statistical procedure to figure out a transformation of the data, and see if we could squeeze most of the information into a few transformed time series? Thanks! __

Re: [R] Need a faster function to replace missing data

2009-05-22 Thread jim holtman
Here is a modification that should now find the closest: myvscan-data.frame(c(1,NA,1.5),as.POSIXct(c(12:00:00,12:14:00,12:20:00), + format=%H:%M:%S)) # convert to numeric names(myvscan)-c(Latitude,DateTime) myvscan$tn - as.numeric(myvscan$DateTime) # numeric for findInterval

Re: [R] stripchart and ordering of plot

2009-05-22 Thread Andrew Yee
Thanks, that works great. Andrew On Fri, May 22, 2009 at 5:42 PM, William Dunlap wdun...@tibco.com wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Andrew Yee Sent: Friday, May 22, 2009 2:16 PM To: