Re: [R] lme nesting/interaction advice

2008-05-09 Thread Kingsford Jones
On Fri, May 9, 2008 at 4:04 AM, Federico Calboli <[EMAIL PROTECTED]> wrote: >> >> Note that random can be a list: >> >> "a one-sided formula of the form ~x1+...+xn, or a pdMat object with a >> formula >> (i.e. a non-NULL value for formula(object)), or a list of such formulas or >> pdMat >> objects.

Re: [R] getWinProgressBar does not return previous value

2008-05-09 Thread Prof Brian Ripley
On Fri, 9 May 2008, Michael DiPersio wrote: I am trying to use winProgressBar, however I find that although setWinProgressBar updates the value on the screen, getWinProgressBar does not return this value. E.g pb <- winProgressBar() setWinProgressBar(pb, 0.2) getWinProgressBar(pb) [1] 0 It do

[R] irregular time series and multiple, overlaid plots

2008-05-09 Thread falcon
I am new to R and am trying to solve the following problem: I have a data file containing tick-by-tick, millisecond level prices for some stocks. I have another file or two containing orders and trades, again, with millisecond time-stamps. Both of these files are irregularly spaced and the time

Re: [R] question about subseting a dataframe

2008-05-09 Thread Charles Plessy
Le Fri, May 09, 2008 at 11:23:37PM -0400, Dipankar Basu a écrit : > > ex <- data.frame(id=id,year=year,x=x) > > ex1 <- subset(ex[which(ex$id=="A"|ex$id=="B"),]) > > tapply(ex1$x, ex1$id, mean) > ABC > 22.5 32.5 NA Dear Dipankar, The reason for this behaviour is that the class of ex$id

Re: [R] question about subseting a dataframe

2008-05-09 Thread Yasir Kaheil
you need to redefine the factor on ex1$id.. cast it again as.factor to redefine the levels. Dipankar Basu wrote: > > Hi! > > I am using R version 2.7.0 and am working on a panel dataset read into R > as > a dataframe; I call it "ex". The variables in "ex" are: id year x > > id: a character

Re: [R] question about subseting a dataframe

2008-05-09 Thread ronggui
Because id is a factor in your data frame, and the levels (including "C") is kept when subsetted. Here is one way to get ride of "C". > ex1$id <- factor(ex1$id) > tapply(ex1$x, ex1$id, mean) AB 22.5 32.5 On Sat, May 10, 2008 at 11:23 AM, Dipankar Basu <[EMAIL PROTECTED]> wrote: > Hi! > >

[R] question about subseting a dataframe

2008-05-09 Thread Dipankar Basu
Hi! I am using R version 2.7.0 and am working on a panel dataset read into R as a dataframe; I call it "ex". The variables in "ex" are: id year x id: a character string which identifies the unit year: identifies the time period x: the variable of interest (which might contain NAs). Here is an

Re: [R] Not to draw the xaxis ticks in ggplot2

2008-05-09 Thread ronggui
Thanks,Hadley. Another question is how can I know there is a grob path called "xaxis::ticks"? Is there any easy way to figure out? Thanks in advance. On Wed, May 7, 2008 at 10:06 PM, hadley wickham <[EMAIL PROTECTED]> wrote: > On Tue, May 6, 2008 at 11:44 PM, ronggui <[EMAIL PROTECTED]> wrote: >

Re: [R] how to check linearity in Cox regression

2008-05-09 Thread Steven McKinney
> -Original Message- > From: [EMAIL PROTECTED] on behalf of array chip > Sent: Fri 5/9/2008 2:54 PM > To: [EMAIL PROTECTED] > Subject: [R] how to check linearity in Cox regression > Hi, I am just wondering if there is a test available for testing if a linear > fit of an independent vari

[R] Resolved tklistbox selection problem

2008-05-09 Thread Mark Coletti
Turns out I needed to add "exportselection=0". So: foo.lb <- tklistbox(root, height = 5, selectmode = "extended", exportselection = 0) Got this from: http://tolstoy.newcastle.edu.au/R/e2/help/06/12/6955.html (That's what I get for assuming there'd be no tcl/tk questions on

[R] Odd tcl/tk listbox problem

2008-05-09 Thread Mark Coletti
I get strange behavior when a GUI has more than one list box. Variable selection between the two boxes appears to be mutually exclusive! So, for the contrived example below: library(tcltk) > > root = tktoplevel() > > foo = c("foo","bar", "baz", "quux") > > foo.list <- tclVar() > > tclObj(foo.lis

Re: [R] Query: how to add quotes when importing a txt file

2008-05-09 Thread Gabor Grothendieck
Just to follow up based on offline discussion the problem is that column one values were being interpreted as numeric (since they are all numbers) so that, for example, 09122007 was interpreted as 9122007 without the leading zero. In such a case the day was regarded as 91 which, of course, can't b

[R] Create pairwise table from columns?

2008-05-09 Thread knussear
Hi Group I have a large data set of individual pairwise values (250,000 rows) that I need to reshape into a pairwise matrix for mantel tests of these values versus genetic distances. the data are currently in columns formatted like so AnimalA, AnimalB, Score A1, A2, S1 A1, A3, S2 A1, A4, S3 A2,

[R] A question about GEE library

2008-05-09 Thread Bill Hyman
Hi all, It seems that GEE does not work when all predictive variables add up to a constant. For example, Y ~ X1+X2+X3. If, for each data point, we have x1+x2+x3=1, the algorithm fails. Could anyone tell me why this would happen? Thank you!

[R] Log likelihood estimation using bivariate archimedean copula

2008-05-09 Thread kakul modani
Hi all, I am trying to build a copula model using the Gumbel Copula and I have two marginal distributions.I know the marginal parameters by using the fitdistr() and optim().The problem is I dont know my copula parameter. I am getting a bit confused of how shall I go about it.I read the previous th

Re: [R] save to file

2008-05-09 Thread Duncan Murdoch
On 09/05/2008 5:55 PM, mtrp mtrp wrote: Hi, I am new to R. I am using spatstat package to generate some sample points but don't know how to save the result to file. Could anyone please give me some instructions? Thanks I generate some random point data by using: pp<-runifpoint(100) I can plot

[R] [R-pkgs] ncf package version 1.0-4

2008-05-09 Thread Karine Berthier
Hi, I am looking for the ncf package version 1.0-4 (O. Bjornstad, 2003) and more particularly for the function oldncf2D to estimate correlation function in four directions. This function is not included in the new version of the ncf package and I do not want to use all the spatial locations a

[R] For Social Network Analysis-Graph Analysis - How to convert 2 mode data to 1 mode data?

2008-05-09 Thread Messing, Solomon O.
Hi, Does anyone know of a package in R that has a function to convert network data (e.g. an adjacency matrix or ) from 2-mode to 1-mode? I am conducting social network analysis. I know that Pajek has this function under Net --> Transform --> 2-mode to 1-mode --> Rows. I have searched the doc

[R] save to file

2008-05-09 Thread mtrp mtrp
Hi, I am new to R. I am using spatstat package to generate some sample points but don't know how to save the result to file. Could anyone please give me some instructions? Thanks I generate some random point data by using: pp<-runifpoint(100) I can plot it out with plot(pp) I suppose that pp co

[R] how to check linearity in Cox regression

2008-05-09 Thread array chip
Hi, I am just wondering if there is a test available for testing if a linear fit of an independent variable in a Cox regression is enough? Thanks for any suggestions. John Zhang [[elided Yahoo spam]]

Re: [R] lme() with two random effects

2008-05-09 Thread Andrew Robinson
Hi Mike, I strongly suggest that you study Pinheiro and Bates (2000) to help you make good decisions on the model specification and subsequent steps. In the meantime, you might find that exploring lme( x ~ gender*con*int*tone*cue , random = ~ age | sub , data = a ) is he

[R] BiodiversityRGUI

2008-05-09 Thread Branimir Hackenberger
Dear all! Would anybody try to explain why could be impossible to use any of constrained ordination methods under BiodiversityRGUI. All attempts are finishing with empty function windows end next error massage: Error in get(x, envir = RcmdrEnv(), mode = mode, inherits = FALSE) : variab

Re: [R] SSOAP: arguments passed as

2008-05-09 Thread Duncan Temple Lang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Steffen. ~ Yes, the SSOAP WSDL processor can't handle that at present (thanks for the example). In this particular case, things are quite simple as it is getting stuck when dealing with the return type and this is just a string. So if we ju

[R] prediction with ridge regression

2008-05-09 Thread Rodrigo Briceño
I'm running a ridge regression of Y over 8 explanatory variables. The selection of lambda gave me a value of 1 as the minimum value to be added for bias. I got the coeficients for this new regression. The thing is that I have 8 new values for explanatory variables that are needed in order to predic

Re: [R] Which gls models to use?

2008-05-09 Thread Kingsford Jones
Tom, I've never used lm.gls, but a quick look at the help page suggests that, unlike gls, it doesn't have built-in functionality to estimate parameters to structure the response/error covariance matrix. I believe it assumes the covariance matrix is known (hopefully someone will correct me if I'm

Re: [R] Rescaling a column in a matrix based on a certain rows

2008-05-09 Thread Jorge Ivan Velez
Hi Anh, If I undestarstand: # Your matrix set.seed(123) mat<-matrix(cbind(rnorm(20),rnorm(20)), ncol = 2) # Scale (mat-apply(mat[1:5,],2,mean))/apply(mat[1:5,],2,sd) HTH, Jorge On Fri, May 9, 2008 at 3:51 PM, Anh Tran <[EMAIL PROTECTED]> wrote: > Hi, > Let say I have this matrix: > > > mat

[R] Rescaling a column in a matrix based on a certain rows

2008-05-09 Thread Anh Tran
Hi, Let say I have this matrix: > mat<-matrix(cbind(rnorm(20),rnorm(20)), ncol = 2) And I want to rescale values of column [,1] and [,2] using values from row 1 to 5, such that the values of row 1:5 should be rescale to the same amplitude (kinda like take the z-score of population from row 1:5).

Re: [R] histogram() with "Date" class?

2008-05-09 Thread Deepayan Sarkar
On 5/9/08, Ola Caster <[EMAIL PROTECTED]> wrote: > > Sorry for spamming the list... > > > I noticed that if you first produce a date histogram with the hist() > function, like this: > > basic.histogram <- hist(my.data$date, breaks = "months", plot = FALSE) > > and then try to transfer the breaks fr

Re: [R] RMSE and lm

2008-05-09 Thread Peter Dalgaard
tom soyer wrote: Hi, Does anyone know if the RMSE is one of the values provided by the lm model, or do we have to calculate it by hand from the residuals? Thanks, summary(my.fit)$sigma -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistic

[R] RMSE and lm

2008-05-09 Thread tom soyer
Hi, Does anyone know if the RMSE is one of the values provided by the lm model, or do we have to calculate it by hand from the residuals? Thanks, -- Tom [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.e

[R] lme() with two random effects

2008-05-09 Thread Mike Lawrence
Hi all, I have collected response time data from 178 participants ('sub') for each combination of 4 within-Ss factors ('con','int','tone','cue'). Additionally, I have recorded the gender of each participant, so this forms a between-Ss factor ('gender'). Normally this would be analyzed usi

Re: [R] Data frame row manipulation

2008-05-09 Thread Jorge Ivan Velez
Hi Chip, Try this: # For Q1 R> C1 = rbind(A,B) or R> C2 = do.call(rbind,list(A,B)) R> all.equal(C1,C2) # TRUE # For Q2 R> set.seed(123) R> vx=1:10 R> A = matrix(rnorm(500),ncol=10) R> A2=t(sapply(A,rep,10)) R> A2[vx,]<- A[vx,] R> A2 R> dim(A2) # 500 10 R> dim(A)# 50 10 HTH, Jorge

[R] getWinProgressBar does not return previous value

2008-05-09 Thread Michael DiPersio
I am trying to use winProgressBar, however I find that although setWinProgressBar updates the value on the screen, getWinProgressBar does not return this value. E.g > pb <- winProgressBar() > setWinProgressBar(pb, 0.2) > getWinProgressBar(pb) [1] 0 I tried the same with tkProgressBar, and it is wo

[R] plot( )

2008-05-09 Thread Qian R
__ 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, minimal, self-contained, reproducible code.

Re: [R] Plotting points on line graphs using xYplot in Hmisc

2008-05-09 Thread John Poulsen
Hello Deepayan, Please ignore my last e-mail and question. The information was easily found in ?panel.segments. Thanks, John On 5/5/08, John Poulsen <[EMAIL PROTECTED]> wrote: > > > Hello, > > I am using xYplot to plot lines with confidence bands (see test example > below). I would lik

[R] Simulated annealing method with restarts

2008-05-09 Thread Gordon, Bernard (Research)
Hello R-Help, I'm using R to do some optimization, specifically using the optim method with method = 'SANN' (simulated annealing). I read the help file, and noticed that this method does not include restarts/reheats, which I think would help my optimization significantly. Does anyone know of a

[R] (no subject)

2008-05-09 Thread Tasneem Zaihra
__ 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, minimal, self-contained, reproducible code.

[R] Data frame row manipulation

2008-05-09 Thread Chip Barnaby
Greetings, Q #1 -- How does one combine data frames by row ... no cleverness a la merge(), just add rows. For example, given A with 20 rows and B with 30 rows, I want C = combine( A, B) having 50 rows. Columns having matching names should be filled from both (all) sources with suitabl

Re: [R] how to plot two graphs in one figure

2008-05-09 Thread stephen sefick
#try this plot(survival) lines(suvival) On Fri, May 9, 2008 at 2:14 PM, Zhandong Liu <[EMAIL PROTECTED]> wrote: > Dear helpers, > I am trying to plot two survival curves in the same figure. > > plot(survival) > // in matlab, one just need to call "hold on" > plot(survival2) > > > I am wondering h

[R] how to plot two graphs in one figure

2008-05-09 Thread Zhandong Liu
Dear helpers, I am trying to plot two survival curves in the same figure. plot(survival) // in matlab, one just need to call "hold on" plot(survival2) I am wondering how to do it in R. Thank you very much! -- Zhandong Liu Genomics and Computational Biology University of Pennsylvania 616 BRB

Re: [R] Plotting a function with a histogram

2008-05-09 Thread Amit Soni
Thank you for your replies. I figured out that curve has an option of add which adds it to a previously existing graph. Thank you, Amit On Fri, May 9, 2008 at 10:07 AM, Amit Soni <[EMAIL PROTECTED]> wrote: > Hi, > > I have a histogram of an array of numbers. > hist(v,10) > > How can I plot a fun

[R] Graphing Continuous Time Markov chain.

2008-05-09 Thread Atul Kulkarni
I have the following data of continuous time Markov chain. Time - [1] 0. 0.01219893 0.35903929 0.69378720 0.77247183 1.56008543 [7] 1.80607724 2.59023990 2.87196272 3.05311707 3.14737319 3.20758500 [13] 3.26668915 3.42428440 3.53324567 3.83668537 3.96784473 4.17196149 [19] 4.29982361 4.

Re: [R] Estimating QAIC using glm with the quasibinomial family

2008-05-09 Thread Darren Gillis
I am glad to have joined such an active online community! I assume from your R code that the deviance reported by R for "quasi..." families is not "quasi-deviance" and that the following function summarizes the calculation (note that I have added a parameter to k to account for the estimation of

Re: [R] which.max2()

2008-05-09 Thread Esmail Bonakdarian
Marc Schwartz wrote: I might be tempted to take a more generic approach, where one can provide an argument to the function to indicate that I want the 'top x' maximum values and to give the user the option of returning the indices or the values themselves. Perhaps: which.max2 <- function(x,

Re: [R] which.max2()

2008-05-09 Thread Esmail Bonakdarian
Dimitris Rizopoulos wrote: try this: v <- rnorm(10) v order(v, decreasing = TRUE)[1:2] Wow .. that is slick! First I thought, wait .. I don't want to reorder the elements, but this doesn't - it just returns the index values in order. I don't really get that from reading the documentation, it's

Re: [R] substitute in graphics

2008-05-09 Thread Henrique Dallazuanna
Try this: plot(x, log(x), xlab = "x", ylab = "h(x)", main = bquote(Failure~rate~from~W(eta == .(eta), beta == .(beta))) On Fri, May 9, 2008 at 11:31 AM, Gustave Lefou <[EMAIL PROTECTED]> wrote: > Hello, > > I have to do a few graphics of the same function and this function is > parame

[R] Plotting a function with a histogram

2008-05-09 Thread Amit Soni
Hi, I have a histogram of an array of numbers. hist(v,10) How can I plot a function, say a semi circle, curve(sqrt(2.25-x*x), -1.5,1.5) in the same graph? Thank you [[alternative HTML version deleted]] __ R-help@r-project.org mailing list htt

Re: [R] Tabulation of aggregated data.frame

2008-05-09 Thread Henrique Dallazuanna
Try: xtabs(x ~ Group.2 + Group.1, data=x) On Fri, May 9, 2008 at 1:25 PM, Oh Dong-hyun <[EMAIL PROTECTED]> wrote: > Hi useRs! > > I would like to know how to make aggregated data.frame with aggregate() > tabulated. > > For example, I run the following command to aggregate re with respect to > gr

Re: [R] Tabulation of aggregated data.frame

2008-05-09 Thread Jorge Ivan Velez
Hi there, Try this: R> tapply(aggr$x,aggr[,c(2,1)],function(x) x) Group.1 Group.219921993199419951996199719981999 2000 15 0.16392 0.15467 0.15456 0.15391 0.16511 0.17368 0.17955 0.19805 0.20546 16 0.16237 0.18359 0.13811 0.13988

[R] error using Match package

2008-05-09 Thread Charman, Susan
Dear All I am attempting to use Sekhon's package Match to create a matched data set. I keep getting an error regarding unused arguments whether I put Y in or not. Have I missed something? myps id a propensity score (for treat) calculated from logistic regression mymatch<-match(Y=s

Re: [R] applying cor.test to a (m, n) matrix

2008-05-09 Thread Monica Pisica
Thanks Kenn. I will add your solution to my ever growing colection of functions ;-)) Monica Date: Fri, 9 May 2008 18:35:30 +0300From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Re: [R] applying cor.test to a (m, n) matrixCC: [EMAIL PROTECTED]'ve used the following function (I wrote it some time a

[R] Tabulation of aggregated data.frame

2008-05-09 Thread Oh Dong-hyun
Hi useRs! I would like to know how to make aggregated data.frame with aggregate() tabulated. For example, I run the following command to aggregate re with respect to group1 and group2. > (aggr <- with(final, aggregate(re, group1, group2, mean))) Group.1 Group.2 x 1 1992

Re: [R] Error while making R package

2008-05-09 Thread Vidhu Choudhary
Hi All, *I am still facing the problems in making R package on windows. * -- Making package t1 adding build stamp to DESCRIPTION installing NAMESPACE file and metadata making DLL ... making CGHseg_rewrite.d from CGHseg

Re: [R] How can one make stepAIC and lme

2008-05-09 Thread Prof Brian Ripley
It's a known scoping issue in lme -- you are doing this from a function. Make sure your dataset is visible -- e.g. use with(). On Fri, 9 May 2008, Jorunn Slagstad wrote: Dear R-help I'm working on a large dataset which I have divided into 20 subsets based on similar features. Each subset cons

Re: [R] applying cor.test to a (m, n) matrix

2008-05-09 Thread Kenn Konstabel
I've used the following function (I wrote it some time ago so I don't remember any more why I needed it, but I checked and it still works). I don't think you can get rid of for loops altogether: if you look at the code of apply, you'll see some there too. The argument STATS specifies those compon

[R] Which gls models to use?

2008-05-09 Thread tom soyer
Hi, I need to correct for ar(1) behavior of my residuals of my model. I noticed that there are multiple gls models in R. I am wondering if anyone has experience in choosing between gls models. For example, how should one decide whether to use lm.gls in MASS, or gls in nlme for correcting ar(1)? Do

Re: [R] problem with caretNWS on linux

2008-05-09 Thread Pat Shields
On closer inspection of your specs, you might want to try upgrading your Twisted install. I just checked and am pretty sure that the twistd version is sync'd with the Twisted version. NWS requires Twisted >= 2.1. Pat Peter Tait wrote: Hi Pat, thank you for the response. Yes I am running R o

Re: [R] applying cor.test to a (m, n) matrix - SUMMARY

2008-05-09 Thread Monica Pisica
Hi again, I've got few very good options from the list and since they were not posted to the list, I will provide a summary. Thank you very much to all who answered and I hope this summary will benefit others interested in solving similar problems like that. Yasir Kaheil re-wrote my original

Re: [R] which.max2()

2008-05-09 Thread Marc Schwartz
on 05/09/2008 08:07 AM Esmail Bonakdarian wrote: Hello, which.max() only returns one index value, the one for the maximum value. If I want the two index values for the two largest values, is this a decent solution, or is there a nicer/better R'ish way? max2 <-function(v) { m=which.max(v)

[R] predicting from coxph with pspline

2008-05-09 Thread Hjellvik, Vidar
Hello. I get a bit confused by the output from the predict function when used on an object from coxph in combination with p-spline, e.g. fit <- coxph(Surv(time1, time2, status)~pspline(x), Data) predict(fit, newdata=data.frame(x=1:2)) It seems like the output is somewhat independent of the x-va

Re: [R] MLE for noncentral t distribution

2008-05-09 Thread Spencer Graves
Hi, Martin and Kate: KATE: Do you really want the noncentral t? It has mean zero but strange tails created by a denominator following a noncentral chi-square. The answer Martin gave is for a scaled but otherwise standard t, which sounds like what you want, since you said the "sample mean =

[R] substitute in graphics

2008-05-09 Thread Gustave Lefou
Hello, I have to do a few graphics of the same function and this function is parametrized by two arguments. What I would like is to be able to change the value of these two arguments without changing the plot command. So as to copy paste. I tried the following : x=1:100 eta=10 beta=5 plot(x,h(x

Re: [R] Plotting points on line graphs using xYplot in Hmisc

2008-05-09 Thread John Poulsen
Hello Deepayan, Thanks for the below solution to my graphing problem - just what I was looking for. One quick additional question, where do I change graphical settings (lwd, pch, etc...) for the added points? Thanks, John On 5/5/08, John Poulsen <[EMAIL PROTECTED]> wrote: > > > Hello, >

Re: [R] Is there in R a function equivalent to the mround, as found in most spreadsheets?

2008-05-09 Thread Ottorino-Luca Pantani
Charilaos Skiadas ha scritto: On May 9, 2008, at 5:39 AM, Dieter Menne wrote: If I understand the OP's question properly, the first value is to be a multiple of 50, the second a multiple of 5, and the third a multiple of 1. This can be done with this slight variation on the above theme: a <-

Re: [R] speeding up a special product of three arrays

2008-05-09 Thread Vincent Goulet
Le ven. 09 mai à 03:44, Dimitris Rizopoulos a écrit : try this: A <- matrix(rnorm(10*4), 10, 4) B <- matrix(rnorm(3*4), 3, 4) C <- matrix(rnorm(5*4), 5, 4) nrA <- nrow(A); nrB <- nrow(B); nrC <- nrow(C) ind <- as.matrix(expand.grid(1:nrA, 1:nrB, 1:nrC)) D <- rowSums(A[ind[, 1], ] * B[ind[, 2],

Re: [R] K-Means Clustering

2008-05-09 Thread Don MacQueen
Unfortunately, your data is *not* numeric. That is what the first error message, " 'x' must be numeric", is telling you, and you should believe it. It might look numeric, but it isn't, which is why Ingmar mentioned you might have factors instead of numbers. Your challenge is to discover why. T

[R] How can one make stepAIC and lme

2008-05-09 Thread Jorunn Slagstad
Dear R-help I'm working on a large dataset which I have divided into 20 subsets based on similar features. Each subset consists of observations from different locations and I wish to use the location as a random effect. For each group I want to select regressors by a stepwise procedure and inclu

Re: [R] problem with caretNWS on linux

2008-05-09 Thread Peter Tait
Hi Pat, thank you for the response. Yes I am running R on the same machine as the NWS server. I was doing this on my Windows 2003 server with out any problem. My Linux server has 4 cores and I would like R to take advantage of them. Thank you for your help. Cheers Peter Original Message Fol

Re: [R] Using lme() inside a function (should be: stepAIC from lme inside function)

2008-05-09 Thread Dieter Menne
ONKELINX, Thierry inbo.be> writes: > This solutions works with R 2.7.0 under windows > > library(MASS) > library(nlme) > PredRes <- function(cal, val){ > cal <<- cal > lmemod <- lme(distance ~ age * Sex, random = ~1|Subject, data = cal, > method="ML") > themod <- stepAIC(lmemod, dir=

Re: [R] function in nls argument

2008-05-09 Thread Katharine Mullen
You can take minpack.lm_1.1-0 (source code and MS Windows build, respectively) from here: http://www.nat.vu.nl/~kate/minpack.lm_1.1-0.tar.gz http://www.nat.vu.nl/~kate/minpack.lm_1.1-0.zip The bug that occurs when nprint = 0 is fixed. Also fixed is another problem suggested your example: when th

Re: [R] Using lme() inside a function

2008-05-09 Thread ONKELINX, Thierry
Jorunn, This solutions works with R 2.7.0 under windows library(MASS) library(nlme) PredRes <- function(cal, val){ cal <<- cal lmemod <- lme(distance ~ age * Sex, random = ~1|Subject, data = cal, method="ML") themod <- stepAIC(lmemod, dir="both", trace = FALSE) prs <- predict(them

Re: [R] which.max2()

2008-05-09 Thread Dimitris Rizopoulos
try this: v <- rnorm(10) v order(v, decreasing = TRUE)[1:2] I hope it helps. Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http:/

[R] Using lme() inside a function

2008-05-09 Thread Jorunn Slagstad
Dear R-help I'm working on a large dataset which I have divided into 20 subsets based on similar features. Each subset consists of observations from different locations and I wish to use the location as a random effect. For each group I want to select regressors by a stepwise procedure and include

[R] which.max2()

2008-05-09 Thread Esmail Bonakdarian
Hello, which.max() only returns one index value, the one for the maximum value. If I want the two index values for the two largest values, is this a decent solution, or is there a nicer/better R'ish way? max2 <-function(v) { m=which.max(v) v[m] = -v[m] m2=which.max(v) result=c(m,

Re: [R] Query: how to add quotes when importing a txt file

2008-05-09 Thread Jorge Ivan Velez
Hi Stefano, Take a look at ?read.table and its friends. Now, assuming that your file is "data.txt" you can use, for example: # Option 1 > df=read.table('your.ubication.here/data.txt',header=FALSE) > df # Option 2 Copy your data set in the clipboard and write this in the R Console: > df=read.tab

Re: [R] Query: how to add quotes when importing a txt file

2008-05-09 Thread Michael Rennie
Hi Stefano, Why do you *need* to add the quotes to the text file? If you leave them out, any of the standard methods of reading data (i.e., read.table(filename, sep="") should work. See help(read.table), help(scan), or help(read.fwf) for more info. Mike Stefano Sofia wrote: Dear R users, I

Re: [R] Query: how to add quotes when importing a txt file

2008-05-09 Thread Gabor Grothendieck
On Fri, May 9, 2008 at 8:52 AM, Stefano Sofia <[EMAIL PROTECTED]> wrote: > > Dear R users, > I have a txt file of the form > > 10092007 24.62 24.31 24.90 > 11092007 19.20 23.17 22.10 > 13092007 24.71 27.33 23.10 > 14092007 27.33 27.90 24.10 > 15092007 28.22 28.55 24.30 > 16092007 28.53 29.24 27.40

Re: [R] Reading multiple tables from file

2008-05-09 Thread G. Draisma
Dear Mr Holman, Thanks very much for your help. This is what I was looking for. Gerrit. on 2008-05-08 20:31 jim holtman said the following: Will this do it for you: x <- readLines(textConnection("1 + Pietje + I1 I2 Value + 1 1 0.11 + 1 2 0.12 + 2 1 0.21 + + 2 + Jantje + I1 I2 I3 Value +

[R] Query: how to add quotes when importing a txt file

2008-05-09 Thread Stefano Sofia
Dear R users, I have a txt file of the form 10092007 24.62 24.31 24.90 11092007 19.20 23.17 22.10 13092007 24.71 27.33 23.10 14092007 27.33 27.90 24.10 15092007 28.22 28.55 24.30 16092007 28.53 29.24 27.40 17092007 24.19 30.64 26.80 18092007 22.60 20.62 28.40 19092007 8.89 1.70 14.70 20092007 2

Re: [R] function in nls argument

2008-05-09 Thread Katharine Mullen
You indeed found a bug. I can reproduce it (which I should have tried to do on other examples in the first place!). Thanks for finding it. It will be fixed in version 1.1-0 which I will submit to CRAN soon. On Fri, 9 May 2008, elnano wrote: > > Find the data (data_nls.lm_moyano.txt) here: > ft

Re: [R] function in nls argument

2008-05-09 Thread elnano
Find the data (data_nls.lm_moyano.txt) here: ftp://ftp.bgc-jena.mpg.de/pub/outgoing/fmoyano Katharine Mullen wrote: > > Thanks for the details - it sounds like a bug. You can either send me the > data in an email off-list or make it available on-line somewhere, so that > I and other people ca

Re: [R] A problem with anova()

2008-05-09 Thread Peter Dalgaard
Christian Ritz wrote: > Hi Peter, > > I think one option for what anova could do in the nonlinear case is to > report the analysis of variance (or deviance) table obtained when > doing a lack-of-fit test, that is comparing the nonlinear regression > model to an appropriate ANOVA model. This is for

Re: [R] scrime Package simulatedSNP function

2008-05-09 Thread Neil Shephard
Claire_6700 wrote: > > Hello, > > I need some help with the simulatedSNPs function from scrime package. > > I am trying to simulate some genotype of a case/control disease locus. The > allele frequence are cases/controls > > Sample cases controls > 2000 .5.10 > 1

[R] SSOAP: arguments passed as

2008-05-09 Thread sneumann
Hi, I have a SOAP service, provided by BioMoby which I'd like to call via SSOAP. My service breaks during genSOAPClientInterface() genSOAPClientInterface(def=service, verbose = TRUE) Operation MassBank_Simple_2 Error: Cannot resolve SOAP type in empty context Pr

Re: [R] Multivariate simulation

2008-05-09 Thread Chuck Cleland
On 5/9/2008 6:43 AM, Yemi Oyeyemi wrote: Dear everyone, I am having problem simulating multivariate data. Though I was able to simulate the data, but finding the variance-covariance matrix of simulated data did not give exact covariance matrix used in simulating the data. Unlike some other pack

[R] question on marginal effects

2008-05-09 Thread Renuka Sane
I have a question regarding calculating marginal effects (change in the probability due to a one unit change in x) for a probit or for that matter any discrete choice model. Does R have a function that will essentially do this: dE[y|x] --- = f(x'beta)*beta dx Stata has a

Re: [R] function in nls argument

2008-05-09 Thread Katharine Mullen
Thanks for the details - it sounds like a bug. You can either send me the data in an email off-list or make it available on-line somewhere, so that I and other people can download it. On Fri, 9 May 2008, elnano wrote: > > Thank you Katharine. I am certain nprint is affecting my solution. Let me

Re: [R] function in nls argument

2008-05-09 Thread elnano
Thank you Katharine. I am certain nprint is affecting my solution. Let me know how I can send the data (~300Kb). The script I used it: ST1 <- ST04 SM1 <- SM08 SR1 <- SRch2 ST <- ST1 [!is.na(SR1)] SM <- SM1 [!is.na(SR1)] SR <- SR1 [!is.na(SR1)] q <- 0.90 p <- c("a"=-0.003, "b"=0.1

Re: [R] lme nesting/interaction advice

2008-05-09 Thread Federico Calboli
Note that random can be a list: "a one-sided formula of the form ~x1+...+xn, or a pdMat object with a formula (i.e. a non-NULL value for formula(object)), or a list of such formulas or pdMat objects. " If you can translate that into *informative* English I'd be grateful. I have the Pinheiro a

[R] Multivariate simulation

2008-05-09 Thread Yemi Oyeyemi
Dear everyone, I am having problem simulating multivariate data. Though I was able to simulate the data, but finding the variance-covariance matrix of simulated data did not give exact covariance matrix used in simulating the data. Unlike some other packages, like stata, using command "corr2data

Re: [R] Stepwise regression

2008-05-09 Thread Prof Brian Ripley
On Fri, 9 May 2008, Berthold wrote: I am using stepAIC for stepwise regression modeling. Is there a way to change the entry and exit alpha levels for the stepwise regression using stepAIC ? No, because it does not use 'entry and exit alpha levels', rather AIC. I do not believe you have consu

Re: [R] Is there in R a function equivalent to the mround, as found in most spreadsheets?

2008-05-09 Thread Charilaos Skiadas
On May 9, 2008, at 5:39 AM, Dieter Menne wrote: Dr. Ottorino-Luca Pantani unifi.it> writes: Imagine that for a particular cuvette (I have 112 different cuvettes !!) you have to mix the following volumes of solution A, B, and C respectively. c(1803.02, 193.51, 3.47) Each solution is to

Re: [R] Regarding anova result

2008-05-09 Thread Guru S
Hi S Ellison, Thanks for your response, you said anova in R works two ways; one is single fit, another one is sequence of fits. Single fit is used to fit single nls() model result. If I am wrong plz advice me. I want to use single fit. How to do that? In your example, why the anova(y.nls1

Re: [R] A problem with anova()

2008-05-09 Thread Christian Ritz
Hi Peter, I think one option for what anova could do in the nonlinear case is to report the analysis of variance (or deviance) table obtained when doing a lack-of-fit test, that is comparing the nonlinear regression model to an appropriate ANOVA model. This is for example the use of anova in t

Re: [R] lme nesting/interaction advice

2008-05-09 Thread Dieter Menne
Federico Calboli imperial.ac.uk> writes: > > Hi everyone, > > I am confused on how to specify some nesting and interaction terma with lme(). > > lme(y ~ selection * males, random = ~1|replica/selection/males, mydata) Note that random can be a list: "a one-sided formula of the form ~x1+...+xn

Re: [R] Is there in R a function equivalent to the mround, as found in most spreadsheets?

2008-05-09 Thread Dieter Menne
Dr. Ottorino-Luca Pantani unifi.it> writes: > > In a lab experiment I have to mix three solutions to get different > concentrations of various molecules in a cuvette > > I've used R to calculate the necessary µliters for each of the level of > the experiment and I must confess that it is more

Re: [R] Regarding anova result

2008-05-09 Thread S Ellison
>>> "Guru S" <[EMAIL PROTECTED]> 09/05/2008 08:18 >>> >I fitted tree growth data with Chapman-Richards growth function using nls. >When I try to run the anova() function I get this: >Error in anova.nls(fit.nls) : anova is only defined for sequences of "nls" objects There seem to be two problems

Re: [R] Stepwise regression

2008-05-09 Thread ONKELINX, Thierry
Berthold, stepAIC does model selected based on AIC (or a similar criterion like BIC). So it does not uses the alpha levels. Hence it's pointless to specify them in stepAIC. HTH, Thierry ir. Thierry Onkelinx Instituu

Re: [R] histogram() with "Date" class?

2008-05-09 Thread Ola Caster
Sorry for spamming the list... I noticed that if you first produce a date histogram with the hist() function, like this: basic.histogram <- hist(my.data$date, breaks = "months", plot = FALSE) and then try to transfer the breaks from that histogram to a lattice equivalent, like this: histogram(

[R] Stepwise regression

2008-05-09 Thread Berthold
I am using stepAIC for stepwise regression modeling. Is there a way to change the entry and exit alpha levels for the stepwise regression using stepAIC ? Many thanks, Berthold Berthold Stegemann Bakken Research Center Maastricht The Netherlands [[alternative HTML version deleted]] __

  1   2   >