Re: [R] lme4 and mcmcamp

2007-03-14 Thread Ivar Herfindal
Hello. I ran into a similar situation as you did, and according to D. Bates, this can be due to the inclusion of the offset variable. It appears that the mcmcsamp does not work very well with offset variables. For more details, have a look at this thread:

Re: [R] about bootstrapping

2007-03-14 Thread Chuck Cleland
Ray Cheung wrote: Dear All, I've a 10 by 5 data frame like this set.seed(1001) a - rnorm(10) b - rnorm(10) c - rnorm(10) d - rnorm(10) e - rnorm(10) A - cbind(a,b,c,d,e) Each row is one datum. I want to resample within A[,5]. Fit the regression lines lm(A[,5] ~ A[,1] + A[,2]) and

[R] dataframe layout

2007-03-14 Thread Robert Baer
Can someone remind me how to change the columns in df.a into a two column df.b that contains one column of data and another column of the original column headings as levels. Example: a=1:3 b=4:6 c=7:9 df.a=data.frame(a,b,c) Should become in df.b: dat lev 1 a 2 a 3 a 4 b 5

Re: [R] R: Searching and deleting elements of list

2007-03-14 Thread jastar
This is exactly what I need Thank's a lot!! Guazzetti Stefano wrote: you could try mapply mydata2-mapply([, mydata, lapply(mydata, function(x) !x %in% A)) mydata2[[1]]-A #to replace the obviously deleted elements of A mydata2 mydata2[[1]] mydata2[[2]] mydata2[[3]]

Re: [R] dataframe layout

2007-03-14 Thread Gavin Simpson
On Wed, 2007-03-14 at 03:53 -0500, Robert Baer wrote: Can someone remind me how to change the columns in df.a into a two column df.b that contains one column of data and another column of the original column headings as levels. Example: a=1:3 b=4:6 c=7:9 df.a=data.frame(a,b,c)

Re: [R] dataframe layout

2007-03-14 Thread Chuck Cleland
Robert Baer wrote: Can someone remind me how to change the columns in df.a into a two column df.b that contains one column of data and another column of the original column headings as levels. Example: a=1:3 b=4:6 c=7:9 df.a=data.frame(a,b,c) Should become in df.b: dat lev 1

Re: [R] Power calculation for detecting linear trend

2007-03-14 Thread ONKELINX, Thierry
Erik, I haven't seen an answer to your question, so I'll try to answer it. The problem is that you switched the degrees of freedom. You had: 1 - pf(qf(.95, Vl, 1, ncp = 0), Vl, 1, ncp = Dl) [1] 0.05472242 But it should be: 1 - pf(qf(.95, 1, Vl, ncp = 0), 1, Vl, ncp = Dl) [1] 0.532651 Cheers,

[R] abs(U) 0 where U is a vector?

2007-03-14 Thread Benjamin Dickgiesser
Hi, I am looking for a way to compare if every element of a vector is 0. i.e. while(abs(U) 0) { .. } is there a function for this or do I have to write one? I'd appreciate your help! Benjamin __ R-help@stat.math.ethz.ch mailing list

Re: [R] abs(U) 0 where U is a vector?

2007-03-14 Thread Romain Francois
Benjamin Dickgiesser wrote: Hi, I am looking for a way to compare if every element of a vector is 0. i.e. while(abs(U) 0) { .. } is there a function for this or do I have to write one? I'd appreciate your help! Benjamin Hi, If I understand you correctly, you are not far, is

Re: [R] abs(U) 0 where U is a vector?

2007-03-14 Thread Dimitris Rizopoulos
try: all(U 0) Best, Dimitris Dimitris Rizopoulos Ph.D. Student 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://med.kuleuven.be/biostat/

Re: [R] abs(U) 0 where U is a vector?

2007-03-14 Thread Benjamin Dickgiesser
Thx for all your responses! while(all(abs(U) 0)) { .. } was what I am looking for. On 3/14/07, Benjamin Dickgiesser [EMAIL PROTECTED] wrote: Hi, I am looking for a way to compare if every element of a vector is 0. i.e. while(abs(U) 0) { .. } is there a function for this or do I

Re: [R] Sweave question: prevent expansion of unevaluated reused code chunk

2007-03-14 Thread Duncan Murdoch
On 3/13/2007 7:02 PM, Kevin R. Coombes wrote: Hi, Consider the following (much simplified) Sweave example: -- First, we set the value of $x$: chunk1,eval=FALSE= x - 1 @ Then we set the value of $y$: chunk2,eval=FALSE= y - 2 @ Thus, the overall algorithm has this

Re: [R] abs(U) 0 where U is a vector?

2007-03-14 Thread Alberto Monteiro
Benjamin Dickgiesser wrote: I am looking for a way to compare if every element of a vector is 0. i.e. while(abs(U) 0) { .. } Notice that abs(U) [and, in general, most functions that are defined on scalars, like sin, cos, exp, ...], when U is a vector, operates on the _elements_ of

Re: [R] abs(U) 0 where U is a vector?

2007-03-14 Thread Charilaos Skiadas
On Mar 14, 2007, at 7:05 AM, Alberto Monteiro wrote: prod(U 0) But this is not the most elegant solution, because there is a function to check if all [and another to check if any] component of a vector of booleans are [is] true: it's all(V) [resp. any(V)]. So: all(U 0) Just for the

[R] rgeom for p (1-p)^(x-1)

2007-03-14 Thread Benjamin Dickgiesser
Hi, is there a package available which lets me generate random data for the geometric distribution with density: p(x) = p (1-p)^(x-1) ? rgeom uses the density p(x) = p (1-p)^x. Thank you, Benjamin __ R-help@stat.math.ethz.ch mailing list

Re: [R] rgeom for p (1-p)^(x-1)

2007-03-14 Thread Charilaos Skiadas
On Mar 14, 2007, at 8:44 AM, Benjamin Dickgiesser wrote: Hi, is there a package available which lets me generate random data for the geometric distribution with density: p(x) = p (1-p)^(x-1) ? rgeom uses the density p(x) = p (1-p)^x. Why not just use rgeom, and then add 1 to all the

Re: [R] Sweave question: prevent expansion of unevaluated reused code chunk

2007-03-14 Thread Seth Falcon
Kevin R. Coombes [EMAIL PROTECTED] writes: [2] You are also correct that there is no advantage if I just call them chunk1 and chunk2. But if I call them something more interesting, like perform.quantile.normalization or truncate.and.log.transform, then I can use this structure to explain the

Re: [R] Sweave question: prevent expansion of unevaluated reused code chunk

2007-03-14 Thread Kevin R. Coombes
Hi, I don't know of a standard way to indicate this; I would have suggested combined,expand=FALSE (with expand=TRUE the default), except for the fact that Seth Falcon already suggested the same notation in his response...so I can only second the motion. Kevin Duncan Murdoch wrote:

[R] Connecting R-help and Google Groups?

2007-03-14 Thread Paul Lynch
This morning I tried to see if I could find the r-help mailing list on Google Groups, which has an interface that I like. I found three Google Groups (The R Project for Statistical Computing, rproject, and rhelp) but none of them are connected to the r-help list. Is there perhaps some reason why

[R] tune.svm

2007-03-14 Thread Aimin Yan
I use tune.svm to tune gamma and cost for my training dataset. I use PC, it runs very slowly. Does anyone know how to make it faster? Aimin __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Connecting R-help and Google Groups?

2007-03-14 Thread Bert Gunter
I know nothing about Google Groups, but FWIW, I think it would be most unwise for R/CRAN to hook up to **any** commercially sponsored web portals. Future changes in their policies, interfaces,or access conditions may make them inaccessible or unfreindly to R users. So long as we have folks willing

Re: [R] tune.svm

2007-03-14 Thread Kuhn, Max
Fast is a relative term. Tell us more about your version, system, data and the kernel that you are using (I'm guessing it is a RBF). If you are building a classification model and there are two classes, the svmpath package can be used to get quick predictions over the cost/regularization

[R] Trimming a Data Set

2007-03-14 Thread Jonathan Morse
Hi, I am trying to restrict a data set so as not to included outliers. Specifically, I would like to specify a percentage where a fraction of observations are eliminated from the data set, much in the same way that the trimmed mean function works - but leaving the restricted data set intact.

Re: [R] Connecting R-help and Google Groups?

2007-03-14 Thread Paul Lynch
Well, I don't see what danger could arise from the fact that Google Groups is owned by a company. Google Groups provides access to all of usenet, plus many mailing lists (e.g. the ruby-talk mailing list for Ruby programmers). They don't control any of the newgroups or mailing lists that they

Re: [R] Connecting R-help and Google Groups?

2007-03-14 Thread Dirk Eddelbuettel
On Wed, Mar 14, 2007 at 11:48:15AM -0400, Paul Lynch wrote: This morning I tried to see if I could find the r-help mailing list on Google Groups, which has an interface that I like. I found three Google Groups (The R Project for Statistical Computing, rproject, and rhelp) but none of them are

[R] How to transform matrices to ANOVA input datasets?

2007-03-14 Thread szhan
Hello, R experts, I have a list called dataHP which has 30 elements (m1, m2, ..., m30). Each element is a 7x6 matrix holding yield data from two factors experimental design, with treatment in column, position in row. For instance, the element 20 is: dataHP[[20]] col1 col2

Re: [R] Trimming a Data Set

2007-03-14 Thread Petr Klasterecky
If it is precise enough for you, you can use trim - function(x,prop=.05) { trimx - x[x quantile(x,prob=(1-prop))] return(trimx) } Petr Jonathan Morse napsal(a): Hi, I am trying to restrict a data set so as not to included outliers. Specifically, I would like to specify a percentage

[R] plot.tune

2007-03-14 Thread Aimin Yan
In plot.tune, default color for contour plot is lightblue. If I want to set several different colors for contour plot, How can I do this? Thanks, Aimin __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] How to transform matrices to ANOVA input datasets?

2007-03-14 Thread Bojanowski, M.J. \(Michal\)
Hi Josh, Consider what follows to convert your data and estimate the models. I am not sure however, what do you want to do after the models are estimated, so my suggestions stop at this point. HTH, Michal # -b-e-g-i-n---R---c-o-d-e- # first i make some data that is similar to yours so i can

Re: [R] plot.tune

2007-03-14 Thread Kuhn, Max
Aimin, Please see color.palette in ?plot.tune. Sorry to be a broken record, but if you want people to help you, you should: - read the help pages before sending an email - run sessionInfo() and send it in the email You run the risk of people ignoring your emails. These steps will help

Re: [R] replicating SAS's proc rank procedure

2007-03-14 Thread rdporto1
Jiho.han, I wonder if there's a way to replicate SAS rank procedure where it ranks a variable by a certain number of groups. For example, it's very easy to calculate quintile rank in SAS, but I couldn't find the similar function in R. Does anyone know how to do this? There are some

[R] ols Error : missing value where TRUE/FALSE needed

2007-03-14 Thread Charles Evans
I have installed Hmisc and Design. When I use ols, I get the following error message: Error in if (!length(fname) || !any(fname == zname)) { : missing value where TRUE/FALSE needed The model that I am running is: ecools - ols(eco$exp ~ eco$age + eco$own + eco$inc + inc2, x=TRUE) I

[R] Logistic regression for drugs Interactions

2007-03-14 Thread francogrex
I have the model below, for which I run a logistic regression including the interaction term (NSAID*Diuretic) fit1=glm(resp ~ nsaid+diuretic+I(nsaid*diuretic), family= binomial,data=w) NSAID DiureticPresent Absent 0 0 185 6527 0 1

[R] Redirecting output to the screen

2007-03-14 Thread John Schuenemeyer
A simple example follows. The file is called Test.R # Example rm(list=is(all=TRUE)) cat(Enter file name) fn-scan(what=) I execute the following: @C:\PROGRA~1\R\R-2.4.1\bin\Rterm.exe --no-restore --no-save Test.R Rout.txt I do not see the Enter file name or have the opportunity to enter the

[R] Cannot create Java Virtual Machine

2007-03-14 Thread Chen, Kaiping
Hi I installed package rJava but .jinit() gives an error Cannot create Java Virtual Machine. Currently, I am running Win XP, with JRE and JDK 1.5 installed. I am not quite familiar with java configuation. Can anyone give some ideas on the error mentioned above? Thanks. - - - - - - - - - - - - - -

Re: [R] ols Error : missing value where TRUE/FALSE needed

2007-03-14 Thread Jason Barnhart
I think that inc2 should be eco$inc2 in your call. If not let me know and I will dig deeper. - Original Message - From: Charles Evans [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Wednesday, March 14, 2007 12:48 PM Subject: [R] ols Error : missing value where TRUE/FALSE needed

Re: [R] Redirecting output to the screen

2007-03-14 Thread jim holtman
First I think you should have 'ls(' instead of 'is('. Second, your standard input if from the Test.R file so you scan won't be reading from the console. Here is what I got when I changed 'is' to 'ls': /cygdrive/c/progra~1/r/r-2.4.1/bin: ./rterm --no-save c:/test.r R version 2.4.1 (2006-12-18)

[R] Wald test and frailty models in coxph

2007-03-14 Thread Julianno Sambatti
Dear R members, I am new in using frailty models in survival analyses and am getting some contrasting results when I compare the Wald and likelihood ratio tests provided by the r output. I am testing the survivorship of different sunflower interspecific crosses using cytoplasm (Cyt),

Re: [R] Connecting R-help and Google Groups?

2007-03-14 Thread Ranjan Maitra
I agree with Bert on this one! Any commercial entity's future policies will not be decided by some group's past understanding. Everything can be explained in terms of shareholder value. I don't see any advantages with tying up to Google groups. We get enough posts every day here to keep us all

[R] Question about testing cointegration using Autoregressive distributed Model (ADL)

2007-03-14 Thread adschai
Hi,I'm just wondering if there is any package for testing cointegration with ADL model. I saw a bunch of packages and list of email thread. There seemed to be no such a specific method. I am following this paper on how to test using ADL but I don't have a tool.

[R] how to understand the interaction of two fixed effects

2007-03-14 Thread genomenet
Hi There, I have two questions about how to understand well about the interaction efffect. 1) Suppose two factors, A and B. A has n levels, B has m levels. Why the degree of freedom of interaction effect of A and B ( here I mean A:B not A*B) is (n-1)*(m-1) not n*m-1? 2) can Lard:Gender be

[R] replacing all NA's in a dataframe with zeros...

2007-03-14 Thread David L. Van Brunt, Ph.D.
I've seen how to replace the NA's in a single column with a data frame * mydata$ncigs[is.na(mydata$ncigs)]-0 *But this is just one column... I have thousands of columns (!) that I need to do this, and I can't figure out a way, outside of the dreaded loop, do replace all NA's in an entire data

Re: [R] replacing all NA's in a dataframe with zeros...

2007-03-14 Thread Jason Barnhart
This should work. test.df - data.frame(x1=c(NA,2,3,NA), x2=c(1,2,3,4), x3=c(1,NA,NA,4)) test.df x1 x2 x3 1 NA 1 1 2 2 2 NA 3 3 3 NA 4 NA 4 4 test.df[is.na(test.df)] - 1000 test.df x1 x2 x3 1 1000 11 22 2 1000 33 3 1000 4 1000 44 The following search

Re: [R] ols Error : missing value where TRUE/FALSE needed

2007-03-14 Thread Frank E Harrell Jr
Charles Evans wrote: I have installed Hmisc and Design. When I use ols, I get the following error message: Error in if (!length(fname) || !any(fname == zname)) { : missing value where TRUE/FALSE needed The model that I am running is: ecools - ols(eco$exp ~ eco$age + eco$own

[R] reading raw matrix saved with writeBin

2007-03-14 Thread Milton Cezar Ribeiro
Dear Friends, I saved a matrix - which contans values 0 and 1 - using following command: writeBin (as.integer(mymatrix), myfile.raw, size=1). It is working fine and I can see the matrix using photoshop. But now I need read the matrices again (in fact I have a thousand of them) as matrix into R

Re: [R] reading raw matrix saved with writeBin

2007-03-14 Thread Ranjan Maitra
On Wed, 14 Mar 2007 18:45:53 -0700 (PDT) Milton Cezar Ribeiro [EMAIL PROTECTED] wrote: Dear Friends, I saved a matrix - which contans values 0 and 1 - using following command: writeBin (as.integer(mymatrix), myfile.raw, size=1). It is working fine and I can see the matrix using

Re: [R] replacing all NA's in a dataframe with zeros...

2007-03-14 Thread Steven McKinney
Since you can index a matrix or dataframe with a matrix of logicals, you can use is.na() to index all the NA locations and replace them all with 0 in one command. mydata.df - as.data.frame(matrix(sample(c(as.numeric(NA), 1), size = 30, replace = TRUE), nrow = 6)) mydata.df V1 V2 V3 V4 V5 1

Re: [R] Sweave question: prevent expansion of unevaluated reused code chunk

2007-03-14 Thread Friedrich Leisch
On Wed, 14 Mar 2007 10:39:43 -0500, Kevin R Coombes (KRC) wrote: Hi, I don't know of a standard way to indicate this; I would have suggested combined,expand=FALSE (with expand=TRUE the default), except for the fact that Seth Falcon already suggested the same notation in his

[R] timeDate object - days, months manipulation arithmetic

2007-03-14 Thread Young Cho
Hi, Thanks so much in advance for your help! I just started using 'timeDate' object to manipulate daily time series data. After reading some documents, I created an object 'bizday' to do some business-day computation. E.g. bizday = timeSequence