Re: [R] nlme problems

2005-12-19 Thread Ken Beath
I meant fitting not maximising, it is a nonlinear mixed effects model, with both fixed and random effects. My assumption is that for the function I am using the approximation approach used in nlme is not quite close enough, and nothing much that I can do, except for looking at starting

[R] Ranking factors given a weight

2005-12-19 Thread Albert Vilella
Hi all, I'm trying to rank a couple of factors by a variable and a weight of the variable in each occurrence (some samples are bigger than others). input = data.frame( alfa = rnorm(5000), weight = rnorm(5000,-5,10), tag1 = sample(c(a,b,c,d),5000,replace=TRUE), tag2 =

Re: [R] Fit non-lineair 3D Data

2005-12-19 Thread Antonio, Fabio Di Narzo
2005/12/18, Bart Joosen [EMAIL PROTECTED]: Hi, I have a problem with fitting a model: I made a dataframe with this data: a - 1:3 b - 1:3 c - c(3, 2, 3, 2, 1, 2, 3, 2, 3) df - expand.grid(a,b) df$result - c names(df) - c(A,B, result) Although I can make a graph

[R] help on barplots

2005-12-19 Thread Björn Rogell
Hello, I am a beginner with R and I would need some help with doing barplots. My problem is that I would like to include both diffrent colors of the bars and precence/absence of shading lines in the barplots. When reading in the help file about the col command it states: col: a vector of

[R] Package boot: How to construct CI from censboot object?

2005-12-19 Thread abdul kudus
Dear all, I run the example of censboot contained in boot package. But, I can't find the confidence interval of the resulted censboot object. Any idea ? aml.fun - function(data) { + surv - survfit(Surv(time, cens)~group, data=data) + out - NULL + st - 1 +

[R] change read.table by scan

2005-12-19 Thread [EMAIL PROTECTED]
Hi all, Before the amount of data given has grown i was initially using read.table to load the values inside R. It was feeding my needs because i could tell read.table h=T, then use attach to access the values by columns names. Now it takes 20 seconds to load the data's and the first

Re: [R] GLM Logit and coefficient testing (linear combination)

2005-12-19 Thread Henric Nilsson
On Sö, 2005-12-18, 17:32, David STADELMANN skrev: Hi, I am running glm logit regressions with R and I would like to test a linear combination of coefficients (H0: beta1=beta2 against H1: beta1beta2). Is there a package for such a test or how can I perform it otherwise (perhaps with logLik()

[R] loess smoothing question

2005-12-19 Thread Thomas L Jones
I am trying to smooth a dataset with evenly spaced values of x, perhaps using loess smoothing or something similar. However, the y values are hypergeometrically distributed; I think I want to use a logarithmic link function. It falls under the general heading of non-parametric regression. The

Re: [R] help on barplots

2005-12-19 Thread Marc Schwartz
On Mon, 2005-12-19 at 12:27 +0100, Björn Rogell wrote: Hello, I am a beginner with R and I would need some help with doing barplots. My problem is that I would like to include both diffrent colors of the bars and precence/absence of shading lines in the barplots. When reading in the help

Re: [R] change read.table by scan

2005-12-19 Thread Prof Brian Ripley
read.table _does_ use scan, so why do you claim scan is faster? There is so much you have not told us that it is impossible to know what you want. Please do read the posting guide and its references and try to ask a question that is not predicated on a falsehood. On Mon, 19 Dec 2005, [EMAIL

[R] How to draw partial grid in plot for spatial-binomial experiment?

2005-12-19 Thread Ruben Roa
DeaR comRades: I have a 2D spatial binomial process as shown in the data and code below. I am plotting the number of trials and the number of successes in the spatial binomial experiments and would like to draw the spatial cells were the trials and successes were counted, i.e. a partial grid in

Re: [R] suggestions for nls error: false convergence

2005-12-19 Thread Christian Ritz
Hi Spencer. When using 'optim' and the first try fails you could: 1) try some other methods: Nelder-Mead, BFGS, ... 2) increase the maximum number of iterations (argument maxit in the control list) 3) specify the argument parscale in the control list, in order to have all parameters of same

Re: [R] How to draw partial grid in plot for spatial-binomial experiment?

2005-12-19 Thread Marc Schwartz (via MN)
On Mon, 2005-12-19 at 11:17 -0200, Ruben Roa wrote: DeaR comRades: I have a 2D spatial binomial process as shown in the data and code below. I am plotting the number of trials and the number of successes in the spatial binomial experiments and would like to draw the spatial cells were the

[R] given a mid-month date, get the month-end date

2005-12-19 Thread t c
I have a vector of dates. I wish to find the month end date for each. Any suggestions? e.g. For 12/15/05, I want 12/31/05, For 10/15/1995, I want 10/31/1995, etc __ [[alternative HTML version deleted]]

Re: [R] given a mid-month date, get the month-end date

2005-12-19 Thread jim holtman
Here is one way using POSIX: (you can create a function to do this) x - as.POSIXlt('2005-12-16') # a date x [1] 2005-12-16 dput(x) #structure of the date structure(list(sec = 0, min = 0, hour = 0, mday = 16, mon = 11, year = 105, wday = 5, yday = 349, isdst = 0), .Names = c(sec, min,

Re: [R] suggestions for nls error: false convergence

2005-12-19 Thread Gabor Grothendieck
Sometimes its just one parameter that's the culprit so just use a grid to get the starting value. Since its known that in logistic growth the saturation level is a problem we conjecture that in this one m is the culprit and grid over it. Note that with this approach we did not need to extend the

Re: [R] given a mid-month date, get the month-end date

2005-12-19 Thread jim holtman
Forgot you were asking for the end date, so just subtract a day: seq(x, by='month', length=2)[2] - 24*3600 [1] 2005-12-31 EST On 12/19/05, jim holtman [EMAIL PROTECTED] wrote: Here is one way using POSIX: (you can create a function to do this) x - as.POSIXlt('2005-12-16') # a date x

Re: [R] nlme problems

2005-12-19 Thread Spencer Graves
Are you familiar with Pinheiro and Bates (2000) Mixed-Effects Models in S and S-Plus (Springer)? I suspect that book, especially the latter half, might contain the information you seek. spencer graves p.s. PLEASE do read the posting guide!

Re: [R] given a mid-month date, get the month-end date

2005-12-19 Thread Gabor Grothendieck
The zoo package has a yearmon class with as methods which can be used: library(zoo) dd - Sys.Date() # test data as.Date(as.yearmon(dd), frac = 1) as.yearmon converts the Date class date to a year and month of class yearmon dropping the day and representing it internally in a way consistent

Re: [R] given a mid-month date, get the month-end date

2005-12-19 Thread Whit Armstrong
Or add a month, then subtract a day: Ndays - function(posix.ct.dates,days) { # one day = 60*60*24 = 86400 seconds ans - as.POSIXct(posix.ct.dates) + 86400*days # we only have a problem if the date went from # DST to ST or from ST to DST ans + (as.POSIXlt(posix.ct.dates)$isdst

Re: [R] what does this warnings mean? and what should I do?

2005-12-19 Thread Berton Gunter
Spencer: (warning: highly biased, personal opinions) My $.02 Looking now at your output, I notice that Corr between (Intercept) and trust.cz1 for the Random Effects commid is 1.000. This says that the structure of your data are not adequate to allow you to distinguish between

Re: [R] How to draw partial grid in plot for spatial-binomial experiment?

2005-12-19 Thread Roger Bivand
On Mon, 19 Dec 2005, Marc Schwartz (via MN) wrote: On Mon, 2005-12-19 at 11:17 -0200, Ruben Roa wrote: DeaR comRades: I have a 2D spatial binomial process as shown in the data and code below. I am plotting the number of trials and the number of successes in the spatial binomial

Re: [R] given a mid-month date, get the month-end date

2005-12-19 Thread Spencer Graves
If you work much with time data and time series data and you have not already mastered the zoo package, you may be interested in a small testimonial from one unfamiliar with the names of Achim Zeileis and Gabor Grothendieck two years ago: The package itself seems to have many useful

Re: [R] glmmADMB: Generalized Linear Mixed Models using AD Model Builder

2005-12-19 Thread Hans Julius Skaug
Douglas Bates wrote: The Laplace method in lmer and the default method in glmm.admb, which according to the documentation is the Laplace approximation, produce essentially the same model fit. One difference is the reported value of the log-likelihood, which we should cross-check, and another

[R] aggregate and ordered factors, feature?

2005-12-19 Thread David James
Hi, aggregate() does not preserve the order of levels for ordered factors, e.g., levs - c(Low, Med, Hi) d - data.frame(x = 1:30, fac = ordered(rep(levs, 10), levels = levs)) out - aggregate(d[,x], by = list(fac=d$f), FUN = mean) cat(Original ordered levels:, levels(d$fac), \n)

[R] Generate random variables with a specific hazard

2005-12-19 Thread Mai Zhou
Dear R-help: I am trying to re-produce the simulations of Kosorok and Lin (1999) JASA, (The versatility of function-indexed weighted log-rank test, 320-332). I need help to generate random variables in R with hazard function: h(t) = 2*t*exp{ 0.96 * exp(-4*t^2) } for t 0. This is the

[R] Guide - install Rcmdr and JGR on (SUSE) Linux

2005-12-19 Thread Gunnar Hellmund
Hi! I have made a guide describing how to install Rcmdr and JGR on SUSE 10.0. Here it is: http://www.hellmund.dk/RSUSEGUI.html If you have installed R on SUSE with the package found on CRAN - and all the packages on my list was present at the time of installation of R - it might not be necessary

Re: [R] glmmADMB: Generalized Linear Mixed Models using AD Model Builder

2005-12-19 Thread Douglas Bates
On 12/19/05, Hans Julius Skaug [EMAIL PROTECTED] wrote: Douglas Bates wrote: The Laplace method in lmer and the default method in glmm.admb, which according to the documentation is the Laplace approximation, produce essentially the same model fit. One difference is the reported value of

Re: [R] autocorrelation test

2005-12-19 Thread Spencer Graves
I'm not certain I understand your question. However, I did the following as I thought it might produce something that you could use: RSiteSearch(vector field correlation) This produced 25 hits, several of which might interest you. In particular, I wonder of you

Re: [R] partially linear models

2005-12-19 Thread Spencer Graves
I have seen no replies to this post, and I don't know that I can help, either. However, I wonder if you tried RSiteSearch with your favorite key words and phrases? For example, I just got 107 hits for 'RSiteSearch(wavelets)'. I wonder if any of them might help you. If

Re: [R] loess smoothing question

2005-12-19 Thread Berton Gunter
If the y values are hypergeometrically distributed then they are counts, right? Loess is designed for continuous, reasonably symmetric data, and so is inappropriate. You should probably consider GLM for a parametric fit; or perhaps GAM for a nonparametric fit. As the data appear to have the

[R] R package for x-12-arima

2005-12-19 Thread Neha
Hi, Vikram and I are beginning work on a native R package to interface into X-12-arima.We have looked through gretl, and previous discussions on kludgy interfaces involving calls to the x12a binary. Our aim is to port as much of the functionality as possible with native R

Re: [R] partially linear models

2005-12-19 Thread Liaw, Andy
This doesn't look like an R question, as I know of no pre-packaged functionality publicly available that can fit the model that Elizabeth described, and it doesn't seem like she's particularly interested in an R-based answer, either. My gut feeling is that if there is a test of significance for

[R] Outputing dataframe or vector from within a user defined function

2005-12-19 Thread Andrew Cox
Hi, I have written a user defined function that carries out a monte carlo simulation and outputs various stats. I would like to access and store the simulation data (a two column local variable) from outside the function I have written. How can I output the data from the function as new variable,