Re: [R] find value between two other numbers?

2010-08-13 Thread baptiste auguie
Hi, I see no need to construct the vector, try this instead, belong = function(x=4, y=c(1,10)) x = y[2] x = y[1] see also ?findInterval HTH, baptiste On 13 August 2010 01:10, fishkbob fishk...@gmail.com wrote: So basically I want to do this - 4 %in% 1:10 should return true Would

Re: [R] mlogit error

2010-08-13 Thread Achim Zeileis
On Fri, 13 Aug 2010, Maha Bakoben wrote: Hi, I'm trying to fit a multinomial logistic regression to my data which consists of 5 discrete variables (scales 1:10) and 1000 observations. I get the following error: Error in `row.names-.data.frame`(`*tmp*`, value = c(NA.NA, NA.NA, : duplicate

Re: [R] Running something without a loop when the result from the previous iteration is require for the current iteration

2010-08-13 Thread Petr PIKAL
Hi wootten.adrie...@gmail.com napsal dne 12.08.2010 14:15:30: Not quite what I was trying to say. The process generates a random uniform number between 0 and 1 and compares to a specific conditional probability. It is looking for this in particular: random number Pr(

[R] Odp: help

2010-08-13 Thread Petr PIKAL
Hi write.table(tab, clipboard, sep = \t, row.names = FALSE) or write.table(tab, somefile.xls, sep = \t, row.names = FALSE) Regards Petr r-help-boun...@r-project.org napsal dne 13.08.2010 01:47:40: I need a code to export my output to excel 2007.I am dealing with observations of

Re: [R] build.pl in building library with Rtools211

2010-08-13 Thread Uwe Ligges
On 12.08.2010 22:52, Hintzen, Niels wrote: R CMD build (lower case) indeed works. I was confused with older versions of Rtools where it didn't matter if you used lower or upper case (as well as that I thought under DOS Actually, we are using the Windows command shell rather than any DOS.

Re: [R] assignment functions with inherited class error

2010-08-13 Thread egc
it works! Thanks. __ 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] loop for inserting rows in a matrix

2010-08-13 Thread Chandra Salgado Kent
Dear R friends, I have a matrix with 2060 rows and 41 columns. One column is Date, another is Transect, and another is Segment. I want to ensure that there are 9 Transects (1 to 9) for each Date, and 8 Segments (1 to 8) for each Transect in the matrix, by inserting rows where these are

[R] cacheSweave / pgfSweave driver for package vignette

2010-08-13 Thread baptiste auguie
Dear list, I wish to use a specific driver to process an sweave document in the inst/doc directory of a package. Specifically, I would like to use either cacheSweave or pgfSweave to speed up the creation of the vignette which requires lengthy computations. The same request would also apply to

Re: [R] cacheSweave / pgfSweave driver for package vignette

2010-08-13 Thread Romain Francois
Hi, I've been meaning to ask the same question before. Le 13/08/10 11:01, baptiste auguie a écrit : Dear list, I wish to use a specific driver to process an sweave document in the inst/doc directory of a package. Specifically, I would like to use either cacheSweave or pgfSweave to speed up

[R] Odp: loop for inserting rows in a matrix

2010-08-13 Thread Petr PIKAL
Hi First of all, use data frame instead of matrix. Matrix is vector with dimensions and hence it can not have mixed values (numeric, character, date..). So let's ASDF is your whole data frame

Re: [R] cacheSweave / pgfSweave driver for package vignette

2010-08-13 Thread Gabor Grothendieck
On Fri, Aug 13, 2010 at 5:01 AM, baptiste auguie baptiste.aug...@googlemail.com wrote: Dear list, I wish to use a specific driver to process an sweave document in the inst/doc directory of a package. Specifically, I would like to use either cacheSweave or pgfSweave to speed up the creation

Re: [R] cacheSweave / pgfSweave driver for package vignette

2010-08-13 Thread Claudia Beleites
Dear all, Maybe we should move the discussion to r-devel? So please excuse the cross-posting, it is to tell people at r-help where to find the rest of the discussion (in case you agree with me). I've been wondering about that, too. Gabor, I use fake vignettes along your lines, too. In

Re: [R] Linear regression on several groups

2010-08-13 Thread Allan Engelhardt
Please read the posting guide and include a standalone example. Maybe you want something like the results from lm(weight ~ Time, data = ChickWeight, subset = Diet==1) lm(weight ~ Time, data = ChickWeight, subset = Diet==2) ## ... etc ... Then you could do (m - lm(weight ~ Time*Diet, data =

Re: [R] help

2010-08-13 Thread Hans-Peter Suter
or library(xlsReadWrite) write.xls(tab, somefile.xls) # not .xlsx or lots of other possibilities (e.g. RODBC, RExcel, gdata, WriteXLS) you would have found searching the mailling list archive or looking in the R import/export manual or the R wiki... Cheers, Hans-Peter

Re: [R] Running something without a loop when the result from the previous iteration is require for the current iteration

2010-08-13 Thread Adrienne Wootten
I did take your advice and change a few things in it to help it run. After reading through your earlier reply again I understood exactly what you were saying, so I did apply it in my function too. Thanks for all the advice! I appreciate it! Adrienne On Fri, Aug 13, 2010 at 3:29 AM, Petr PIKAL

Re: [R] how to eliminate an element of a list

2010-08-13 Thread Michael Bedward
Hello André, I want to eliminate an element of a list: list - seq(1,5,1) That's not a list, it's a vector s - sample(list,1) lets say s=3 Now I want to remove 3 from the list: list2 = {1,2,4,5} If all values are unique as in your example, this will work x - 1:5 s - sample(x, 1) x - x[ x

[R] Fw: Error in rowSums REPOST

2010-08-13 Thread Amit Patel
For the query below I have also included the follwing information. Thanks for your replies str(FeaturePresenceMatrix) chr [1:65530, 1:40] 0 0 0 0 1 0 0 0 0 ... - attr(*, dimnames)=List of 2 ..$ : chr [1:65530] 4 5 6 7 ... ..$ : chr [1:40] X1 X2 X3 X4 ... ?class

Re: [R] Fw: Error in rowSums REPOST

2010-08-13 Thread Nikhil Kaza
?as.numeric On Aug 13, 2010, at 7:50 AM, Amit Patel wrote: For the query below I have also included the follwing information. Thanks for your replies str(FeaturePresenceMatrix) chr [1:65530, 1:40] 0 0 0 0 1 0 0 0 0 ... - attr(*, dimnames)=List of 2 ..$ : chr [1:65530] 4 5 6 7 ... ..$ :

[R] Odp: Fw: Error in rowSums REPOST

2010-08-13 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 13.08.2010 13:50:20: For the query below I have also included the follwing information. Thanks for your replies str(FeaturePresenceMatrix) chr [1:65530, 1:40] 0 0 0 0 1 0 0 0 0 ... - attr(*, dimnames)=List of 2 ..$ : chr [1:65530] 4 5 6 7

[R] Games

2010-08-13 Thread Silvano
Hi, I want to build the table of a football league with 11 teams. All play together. So will 55 games. Since there are an odd number of teams in each round a team will not play. The games will be: games = urnsamples(1:11, x = c('A','B','C','D','E','F','G','H','I','J','K'), size=2,

Re: [R] Linear regression on several groups

2010-08-13 Thread Eik Vettorazzi
hi, maybe an ANCOVA is what you want, which is also done by lm in R lm(y~x*z) Am 12.08.2010 17:11, schrieb JesperHybel: I have a simple dataset of a numerical dependent Y, a numerical independent X and a categorial variable Z with three levels. I want to do linear regression Y~X for each

[R] Polygon Graph in lattice/ lattice extra

2010-08-13 Thread Sebastian
Hi, I'd like to draw a polygon graph. I used the package lattice extra which includes a function for that (see: http://latticeextra.r-forge.r-project.org/#panel.xyareatheme=default). But i don't want the polygon ending with its filled border at the x-axis (like in my code). Instead it should be

Re: [R] Games

2010-08-13 Thread Michael Bedward
Nice question Silvano ! teams - LETTERS[1:11] matches - combn(teams, 2) draw - data.frame(team1=matches[1,], team2=matches[2,], round=sequence(10:1) + rep(0:9, times=10:1)) Is there a prize :-) Michael On 13 August 2010 21:30, Silvano silv...@uel.br wrote: Hi, I want to build the table of a

Re: [R] creation package

2010-08-13 Thread Uwe Ligges
In my previous maiul I asked you to run R CMD INSTALL at first (rather than R CMD check). You could also look into the mentioned file C:/Rp/namepackage.Rcheck/00install.out But we really need that file to understand what is going on. Uwe Ligges On 13.08.2010 15:12, anderson nuel

Re: [R] Games

2010-08-13 Thread peter dalgaard
On Aug 13, 2010, at 3:10 PM, Michael Bedward wrote: Nice question Silvano ! teams - LETTERS[1:11] matches - combn(teams, 2) draw - data.frame(team1=matches[1,], team2=matches[2,], round=sequence(10:1) + rep(0:9, times=10:1)) Is there a prize :-) Maybe you want to sponsor one, because

[R] How to compare the effect of a variable across regression models?

2010-08-13 Thread Biau David
Hello, I would like, if it is possible, to compare the effect of a variable across regression models. I have looked around but I haven't found anything. Maybe someone could help? Here is the problem: I am studying the effect of a variable (age) on an outcome (local recurrence: lr). I have

Re: [R] How to compare the effect of a variable across regression models?

2010-08-13 Thread Frank Harrell
David, In the Cox and many other regression models, the effect of a variable is context-dependent. There is an identifiability problem in what you are doing, as discussed by @ARTICLE{for95mod, author = {Ford, Ian and Norrie, John and Ahmadi, Susan}, year = 1995, title = {Model

Re: [R] Games

2010-08-13 Thread Silvano
Hi, the solution presented below works, but requires some manual work to get the details right. It is still difficult. require(prob) games = urnsamples(1:11, x = c('A','B','C','D','E','F','G','H','I','J','K'), size=2, replace=F, ordered=FALSE) games (round1 = sample(55,5)) (round2 =

Re: [R] creation package

2010-08-13 Thread anderson nuel
Dear r-help, I try this command R CMD INSTALL,but still there are errors. I look into the installation log file in the namepackage.Rcheck : * using log directory 'C:/Rp/namepackage.Rcheck' * using R version 2.10.1 (2009-12-14) * using session charset: ISO8859-1 * checking for file

[R] hypergeometric vs fisher.test

2010-08-13 Thread Andrea Franceschini
Dear R team, I have a simple question. I tried this command: phyper(17,449,19551,181, FALSE) [1] 1.47295e-07 and then I tried this command: (fisher.test(matrix(c(17,449,181,19551),2,2), alternative='greater'))$p.value [1] 3.693347e-06 Shouldn't be identical the results of the two commands ?

Re: [R] Linear regression on several groups

2010-08-13 Thread JesperHybel
Example is spot on - sr for not providing one myself. The results you calculate are what I'm looking for. Would like a function F where I could type: F(weight ~ Time, data = ChickWeight, SOME ARGUMENT = Diet)) Resulting in for (i in 1:4){ print( lm(weight ~ Time, data = ChickWeight, subset =

[R] different outcomes of P values in SPSS and R

2010-08-13 Thread Leo Vorthoren
I have been using generalized linear models in SPSS 18, in order to build models and to calculate the P values. When I was building models in Excel (using the intercept and Bs from SPSS), I noticed that the graphs differed from my expectations. When I ran the dataset again in R, I got totally

[R] Re : How to compare the effect of a variable across regression models?

2010-08-13 Thread Biau David
OK, thank you very much for the answer.I will look into that. Hopefully I'll find smoething that will work out. Best, David Biau. De : Frank Harrell f.harr...@vanderbilt.edu Cc : r help list r-help@r-project.org Envoyé le : Ven 13 août 2010, 15h 50min 18s

Re: [R] Linear regression on several groups

2010-08-13 Thread Derek Ogle
Have a look at lmList() in the nlme package. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of JesperHybel Sent: Friday, August 13, 2010 7:56 AM To: r-help@r-project.org Subject: Re: [R] Linear regression on several groups

[R] val.prob in the Design package - Calibrated Brier Score

2010-08-13 Thread Kim Fernandes
Hello, I am using the val.prob function in the Design package. I understand how the Brier quadratic error score is calculated, but I do not know how the Brier score computed on the calibrated rather than raw predicted probabilities (B cal) is calculated. My question is: how are the calibrated

[R] Panel regression for zero-inflated count data with over-dispersion?

2010-08-13 Thread Steffen Krutzinna
Hi, my first email, I hope I don't violate any rules. I want to run a panel (cross-section-time-series) regression with fixed effects. I have count data (patent citations) so a Poisson distribution applies. But I also want to control for over-dispersion and and excess zeros. I think I read all

Re: [R] Games

2010-08-13 Thread Michael Bedward
On 13 August 2010 23:29, peter dalgaard pda...@gmail.com wrote: Is there a prize :-) Maybe you want to sponsor one, because your solution certainly doesn't work! I see 10 games in the 10th round, all involving team K. That's not how to arrange a tournament! Yes, I'm not going to get a

Re: [R] Panel regression for zero-inflated count data with over-dispersion?

2010-08-13 Thread Achim Zeileis
On Fri, 13 Aug 2010, Steffen Krutzinna wrote: Hi, my first email, I hope I don't violate any rules. I want to run a panel (cross-section-time-series) regression with fixed effects. I have count data (patent citations) so a Poisson distribution applies. But I also want to control for

Re: [R] Games

2010-08-13 Thread Michael Bedward
OK, second attempt. I think this one is a goer (hope)... teams - LETTERS[1:11] matches - combn(teams, 2) draw - data.frame(team1=matches[1,], team2=matches[2,]) # someone will know how to do this in one line... time - numeric(55) k - 0 for (i in 1:10) { t0 - 2*i - 1 n - 10 - i + 1 for (j

[R] Kalman filter

2010-08-13 Thread FMH
Dear All, Could anyone give me a hand to suggest few packages in R to running Kalman prediction and filtration ? Thanks Fir __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] diff in multiple columns by groups?

2010-08-13 Thread Cristian Montes
Hi, Is there a way to apply the diff operator over a large data frame, by groups in a single function? I have a toy data frame that looks like this: MEASUREMENT BLOCK TRATMENT VALUE1 VALUE2 1 1

Re: [R] hypergeometric vs fisher.test

2010-08-13 Thread peter dalgaard
On Aug 13, 2010, at 3:47 PM, Andrea Franceschini wrote: Dear R team, I have a simple question. I tried this command: phyper(17,449,19551,181, FALSE) [1] 1.47295e-07 and then I tried this command: (fisher.test(matrix(c(17,449,181,19551),2,2), alternative='greater'))$p.value [1]

Re: [R] val.prob in the Design package - Calibrated Brier Score

2010-08-13 Thread Frank Harrell
Please check the code. I hope that Brier is on the uncalibrated probabilities. Calibrated probabilities are from 1/(1+exp(-[a+b logit(uncalibrated probs)]) where a and b are maximum likelihood estimators (they will be 0 and 1 in training data). Frank Frank E Harrell Jr Professor and

Re: [R] Games

2010-08-13 Thread peter dalgaard
On Aug 13, 2010, at 4:45 PM, Michael Bedward wrote: teams - LETTERS[1:11] matches - combn(teams, 2) draw - data.frame(team1=matches[1,], team2=matches[2,]) # someone will know how to do this in one line... time - numeric(55) k - 0 for (i in 1:10) { t0 - 2*i - 1 n - 10 - i + 1 for

Re: [R] Games

2010-08-13 Thread peter dalgaard
On Aug 13, 2010, at 5:15 PM, peter dalgaard wrote: On Aug 13, 2010, at 4:45 PM, Michael Bedward wrote: teams - LETTERS[1:11] matches - combn(teams, 2) draw - data.frame(team1=matches[1,], team2=matches[2,]) # someone will know how to do this in one line... time - numeric(55) k - 0

Re: [R] Games

2010-08-13 Thread Hans W Borchers
Silvano silvano at uel.br writes: Hi, I want to build the table of a football league with 11 teams. All play together. So will 55 games. Since there are an odd number of teams in each round a team will not play. The easy solution is moving around a table with one team pausing.

Re: [R] hypergeometric vs fisher.test

2010-08-13 Thread Andrea Franceschini
I ask the question also because I found this line in Wikipedia: The test (see above) based on the hypergeometric distribution (hypergeometric test) is identical to the corresponding one-tailed version of Fisher's exact test. Is this wrong ? May I kindly ask a friendly explanation for

[R] Learning ANOVA

2010-08-13 Thread Stephen Liu
Hi folks, R on Ubuntu 10.04 64 bit. Performed following steps on R:- ### to access to the object data(InsectSprays) ### create a .csv file write.csv(InsectSprays, InsectSpraysCopy.csv) On another terminal $ sudo updatedb $ locate InsectSpraysCopy.csv /home/userA/InsectSpraysCopy.csv ###

Re: [R] Learning ANOVA

2010-08-13 Thread Erik Iverson
Performed following steps on R:- ### to access to the object data(InsectSprays) ### create a .csv file write.csv(InsectSprays, InsectSpraysCopy.csv) On another terminal $ sudo updatedb $ locate InsectSpraysCopy.csv /home/userA/InsectSpraysCopy.csv ### Read in some data test01 -

Re: [R] find value between two other numbers?

2010-08-13 Thread fishkbob
Awesome, that works great, and it cuts my runtime down by a lot. thanks baptiste I totally forgot that I could just check to see if the number was inbetween via less than and greater than rather than having to construct the vector. findInterval also helps with another problem I was having

Re: [R] Re : How to compare the effect of a variable across regression models?

2010-08-13 Thread Bert Gunter
Just to amplify a bit on what Frank said... Except in special circumstances (othogonal designs, say), regression models are only guaranteed to produce useful predictions -- they may not tell you anything meaningful about the relative effects of the regressors because, as Frank said, that depends

[R] variation of the aggregate function

2010-08-13 Thread Eva Nordstrom
Is there a more efficient/elegant way to obtain the result z below. a - c('pink','pink','blue','blue','gold','gold') b - c(5,8,9,12,7,4) agg - aggregate(x=b,by=list(a), FUN='mean') m - match(a, agg[,1]) z - agg[m,2] z [[alternative HTML version deleted]]

[R] RDCOMClient interface - problems setting a variable

2010-08-13 Thread Mark Heckmann
I try to produce and modify shapes in a PowerPoint presentation but run into a difficulty setting a variable. library(RDCOMClient)# load RDCOMClient package library(SWinTypeLibs) # package SWinTypeLibs from

Re: [R] Panel regression for zero-inflated count data with over-dispersion?

2010-08-13 Thread David Atkins
Steffen-- You might want to take a look at the MCMCglmm package by Jarrod Hadfield. It can run a zero-inflated overdispersed Poisson model with random-effects. (I realize you asked about a fixed-effects model, but MCMCglmm ought to functionally give you what you want -- an appropriate

Re: [R] Learning ANOVA

2010-08-13 Thread Liaw, Andy
From: Stephen Liu Hi folks, R on Ubuntu 10.04 64 bit. Performed following steps on R:- ### to access to the object data(InsectSprays) ### create a .csv file write.csv(InsectSprays, InsectSpraysCopy.csv) On another terminal $ sudo updatedb $ locate InsectSpraysCopy.csv

Re: [R] Learning ANOVA

2010-08-13 Thread Stephen Liu
Hi Erik, I followed following video as example; ANOVA in R http://www.youtube.com/watch?v=Dwd3ha0P8uwfeature=related Now I got it done; boxplot(test01$count ~ test01$spray) Continued: InsectSprays.aov -(test01$count ~ test01$spray) summary(InsectSprays.aov) Length ClassMode

[R] some helpful tips on using RODBC

2010-08-13 Thread Mike Williamson
Hey everyone, I don't have a question. Instead some helpful advice with things I've learned from trying to connect 'R' to databases using RODBC. ROBDC is a very handy tool that, once you have everything fixed up nicely, is a great way to have scripts run fairly autonomously, safe in

Re: [R] variation of the aggregate function

2010-08-13 Thread Gabor Grothendieck
On Fri, Aug 13, 2010 at 12:26 PM, Eva Nordstrom eva.nordst...@yahoo.com wrote: Is there a more efficient/elegant way to obtain the result z below. a - c('pink','pink','blue','blue','gold','gold') b - c(5,8,9,12,7,4) agg - aggregate(x=b,by=list(a), FUN='mean') m - match(a, agg[,1]) z -

[R] Dealing with data

2010-08-13 Thread TGS
# how would I code in R to look at the letter of the alphabet # in the second column and create a indicator column for the # corresponding letter? data(InsectSprays) InsectSprays$spray __ R-help@r-project.org mailing list

Re: [R] Dealing with data

2010-08-13 Thread David Winsemius
On Aug 13, 2010, at 1:03 PM, TGS wrote: # how would I code in R to look at the letter of the alphabet # in the second column and create a indicator column for the # corresponding letter? data(InsectSprays) InsectSprays$spray It's already what most people mean when they say indicator column,

Re: [R] Games

2010-08-13 Thread Greg Snow
How about: tmp - expand.grid(one = 1:11, two = 1:11) tmp$week - ( ( tmp$one + tmp$two ) %% 11 ) + 1 # reformat for simplicity tmp2 - tmp[ order(tmp$week), ] tmp3 - tmp2[ tmp2$one tmp2$two , ] ### do some checks to make sure everyone plays everyone ###exactly once and each team plays at

Re: [R] Dealing with data

2010-08-13 Thread TGS
To clarify, I'd like to create a column of indicators for the respective letters so that I could maybe do regression on indicators, etc. For instance, A gets 1, B gets 2, and so on. On Aug 13, 2010, at 10:19 AM, David Winsemius wrote: On Aug 13, 2010, at 1:03 PM, TGS wrote: # how would I

Re: [R] Kalman filter

2010-08-13 Thread Ben Bolker
FMH kagba2006 at yahoo.com writes: Dear All, Could anyone give me a hand to suggest few packages in R to running Kalman prediction and filtration ? Teach a person to fish ... install.packages(sos) library(sos) findFn(kalman) ## perhaps this could be added to the posting guide?

[R] Installation problem

2010-08-13 Thread Giovanni Petris
I am trying to install R-2.11.1 from sources on Ubuntu 10.04. I am getting the following error when I run ./configure: configure:6683: checking how to run the C preprocessor configure:6753: result: gcc -E configure:6773: gcc -E -I/usr/local/include conftest.c configure:6773: $? = 0

[R] how to convert timeSeries to class POSIXct

2010-08-13 Thread Susana Santos
Hello. I´m studing extreme values and i´m using the packages: evd, fExtremes and evir. I need to convet timeSeries (or data.frame) to class POSIXct. Like bmw data: is(bmw) [1] numeric vector index_timeSeries Please help!! Thank you [[alternative HTML version deleted]]

Re: [R] Installation problem

2010-08-13 Thread Erik Iverson
Giovanni Petris wrote: I am trying to install R-2.11.1 from sources on Ubuntu 10.04. Any particular reason? There are Ubuntu packages available... I am getting the following error when I run ./configure: configure:6683: checking how to run the C preprocessor configure:6753: result: gcc -E

Re: [R] Dealing with data

2010-08-13 Thread Greg Snow
R/S does all of that automatically for you, you do not need to manually create the indicator variables. If you do something like: fit - lm( Sepal.Width ~ Species, data=iris, x=TRUE) Then look at the matrix actually used: fit$x Or the output: summary(fit) You will see that Species was

Re: [R] Dealing with data

2010-08-13 Thread Erik Iverson
TGS wrote: To clarify, I'd like to create a column of indicators for the respective letters so that I could maybe do regression on indicators, etc. For instance, A gets 1, B gets 2, and so on. That's precisely how factors are handled by modeling functions in R! No need to reinvent the

Re: [R] RDCOMClient interface - problems setting a variable

2010-08-13 Thread Mark Heckmann
I just tried to do the same task (see beloew) using the rcom package. This works fine (see below). Still I would like to now how this can be done using RDCOMClient. TIA, Mark library(rcom) ppt - comCreateObject(PowerPoint.Application) pres - comInvoke(comGetProperty(ppt, Presentations), Add)

[R] Unobserved heterogeneity

2010-08-13 Thread fusun gonul
I need to read a data set that has multiple observations per person (like scanner panel data). I want to use optim and compute the objective function person by person where each person has multiple observations (as in latent class models a la Kamakura and Russell (JMR, 1989))? I tried to use the

Re: [R] Dealing with data

2010-08-13 Thread David Winsemius
On Aug 13, 2010, at 1:22 PM, TGS wrote: To clarify, I'd like to create a column of indicators for the respective letters so that I could maybe do regression on indicators, etc. You can just enter that column name in a regression formula. No need to create a separate variable. Try:

Re: [R] How to compare the effect of a variable across regression models?

2010-08-13 Thread Greg Snow
If you just want to visualize the effect on one variable on the response from some different models then you might try Predict.Plot from the TeachingDemos package. It takes a little tweaking to get it to work with cph objects, but here is a basic example (partly stolen from the help page for

Re: [R] Dealing with data

2010-08-13 Thread TGS
# Greg, if R automatically does that then I don't know why it's treating each indicator # as a different regressor. In other words, I am interested in treating 'spray' as one # independent variable. # # Erik, which book do you suggest I read? Thanks. data(InsectSprays) lm(InsectSprays$count ~

Re: [R] Learning ANOVA

2010-08-13 Thread Christopher W Ryan
Read documentation for TukeyHSD by typing the command: ?TukeyHSD The input to that function should usually be, a fitted model object, usually an aov fit. You have not created a fitted model object. This seems to work: model - aov(InsectSprays$count ~ InsectSprays$spray) TukeyHSD(model) The

[R] Delete rpart/mvpart cross-validation output

2010-08-13 Thread Marie-Hélène Ouellette
Dear all, I was wondering if there is a simple way to avoid printing the multiple cross-validation automatic output to the console of recursive partitionning functions like rpart or mvpart. For example... data(spider)

Re: [R] subsetting data points within confidence limit

2010-08-13 Thread Greg Snow
Why would you want to do this? Confidence intervals tell you about the uncertainty of the mean of y give x, not the individual data points. It may make more sense to use prediction intervals that tell you about individuals rather than means, but that still means throwing away alpha% of

[R] Re : Re : How to compare the effect of a variable across regression models?

2010-08-13 Thread Biau David
This is all very interesting indeed. so I appreciate that the effect of a variable will depend on the presence of other variables and that the effect of this variable has a statistical meaning only in a specific model. With the particularity of inconsistency if data arise from non normal

[R] assign multiple variables at once

2010-08-13 Thread Hosack, Michael
R Experts, I would like to create a series of variables without having to assign a separate line of code for each new variable. My dataframe (DF) contains two groups of linked variables (ESP1:ESP9) and (ECRL1:ECRL9). Within ESP1:ESP9 are abbreviated species codes (full dataframe contains 26

Re: [R] Learning ANOVA

2010-08-13 Thread JesperHybel
If you're trying to follow the youtube video you have a typing mistake here: InsectSprays.aov -(test01$count ~ test01$spray) I think this should be: InsectSprays.aov -aov(test01$count ~ test01$spray) youre missing the functioncall aov on the right hand side of the assignment operator '-'.

Re: [R] Re : Re : How to compare the effect of a variable across regression models?

2010-08-13 Thread Frank Harrell
Frank E Harrell Jr Professor and ChairmanSchool of Medicine Department of Biostatistics Vanderbilt University On Fri, 13 Aug 2010, Biau David wrote: This is all very interesting indeed. so I appreciate that the effect of a variable will depend on the

[R] Equality of Vectors

2010-08-13 Thread Downey, Patrick
Hello, Is there a way to get a single TRUE or FALSE statement from comparing two vectors? For example, c(1,2,3) == c(1,2,3) produces TRUE TRUE TRUE where I would like it to produce only TRUE for use in an if statement. Likewise, when two vectors are not exactly identical (in all elements) I

Re: [R] Re : Re : How to compare the effect of a variable across regression models?

2010-08-13 Thread Bert Gunter
Comments inline below. -- Bert On Fri, Aug 13, 2010 at 11:04 AM, Biau David djmb...@yahoo.fr wrote: This is all very interesting indeed. so I appreciate that the effect of a variable will depend on the presence of other variables and that the effect of this variable has a statistical

Re: [R] Equality of Vectors

2010-08-13 Thread Nikhil Kaza
?all nikhil.l...@gmail.com On Aug 13, 2010, at 2:49 PM, Downey, Patrick wrote: c(1,2,3) == c(1,2,3) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Equality of Vectors

2010-08-13 Thread Phil Spector
?all - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] Equality of Vectors

2010-08-13 Thread Jorge Ivan Velez
Hi Mitch, How about identical()? identical(c(1,2,3), c(1,2,5)) [1] FALSE identical(c(1,2,3), c(1,2,3)) [1] TRUE See ?identical and ?all.equal for more information. HTH, Jorge On Fri, Aug 13, 2010 at 2:49 PM, Downey, Patrick wrote: Hello, Is there a way to get a single TRUE or FALSE

Re: [R] Equality of Vectors

2010-08-13 Thread Derek Ogle
Patrick, See all(). For example, all(c(1,2,3)==c(1,2,3)) [1] TRUE all(c(1,2,3)==c(2,1,3)) [1] FALSE -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Downey, Patrick Sent: Friday, August 13, 2010 1:49 PM To:

Re: [R] Equality of Vectors

2010-08-13 Thread Henrique Dallazuanna
all(c(1, 2, 3) %in% c(1,2,3)) On Fri, Aug 13, 2010 at 3:49 PM, Downey, Patrick pdow...@urban.org wrote: Hello, Is there a way to get a single TRUE or FALSE statement from comparing two vectors? For example, c(1,2,3) == c(1,2,3) produces TRUE TRUE TRUE where I would like it to produce

Re: [R] Equality of Vectors

2010-08-13 Thread Dimitris Rizopoulos
have a look at function all() but also at function all.equal() -- for your example, x1 - c(1,2,3) x2 - c(1,2,3) x3 - c(1,2,5) all(x1 == x2) all(x1 == x3) # this safer isTRUE(all.equal(x1, x2)) isTRUE(all.equal(x1, x3)) I hope it helps. Best, Dimitris On 8/13/2010 8:49 PM, Downey, Patrick

Re: [R] Dealing with data

2010-08-13 Thread Greg Snow
So you want 1 degree of freedom for InsectSprays? You believe that the difference between A and B is exactly the same as between B and C which is exactly the same as between D and E (etc.)? that seems an odd assumption, but you can get that by using as.numeric (as I and others have already

[R] transforming dates into years

2010-08-13 Thread Dimitri Liakhovitski
Hello! If I have in my data frame MyFrame a variable saved as a Date and want to translate it into years, I currently do it like this using zoo: library(zoo) as.year - function(x) as.numeric(floor(as.yearmon(x))) myFrame$year-as.year(myFrame$date) Is there a function that would do it directly -

Re: [R] transforming dates into years

2010-08-13 Thread Henrique Dallazuanna
You've tried: as.numeric(format(Sys.Date(), '%Y')) On Fri, Aug 13, 2010 at 4:36 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Hello! If I have in my data frame MyFrame a variable saved as a Date and want to translate it into years, I currently do it like this using zoo:

Re: [R] transforming dates into years

2010-08-13 Thread David Winsemius
On Aug 13, 2010, at 3:36 PM, Dimitri Liakhovitski wrote: Hello! If I have in my data frame MyFrame a variable saved as a Date and want to translate it into years, I currently do it like this using zoo: library(zoo) as.year - function(x) as.numeric(floor(as.yearmon(x)))

Re: [R] transforming dates into years

2010-08-13 Thread Saeed Abu Nimeh
myFrame$year-years(strptime(x)) On Fri, Aug 13, 2010 at 12:36 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Hello! If I have in my data frame MyFrame a variable saved as a Date and want to translate it into years, I currently do it like this using zoo: library(zoo) as.year

Re: [R] Dealing with data

2010-08-13 Thread TGS
# I wasn't trying to do ANOVA. I was simply trying to figure out how regress count on sprays (this is after I saw another poster asking an unrelated question with the InsectSprays dataset). # # Anyhow, David clarified this but also, thanks for your explanation as well. rm(list = ls()); sprays

[R] decision tree finetune

2010-08-13 Thread Olga Shaganova
My decision tree grows only with one split and based on what I see in E-Miner it should split on more variables. How can I adjust splitting criteria in R? Also is there way to indicate that some variables are binary, like variable Info_G is binary so in the results would be nice to see 2)

Re: [R] Dealing with data

2010-08-13 Thread TGS
But in your comment, it sounded like you were in the realm of ANOVA when you made the degrees of freedom comment. I'm not going to get into the theory of statistics with you :) I'm just trying to learn R, take it easy. Yes, I understand that in the regression problem, the degrees of freedom for

Re: [R] assign multiple variables at once

2010-08-13 Thread Brian Diggs
On 8/13/2010 11:08 AM, Hosack, Michael wrote: R Experts, I would like to create a series of variables without having to assign a separate line of code for each new variable. My dataframe (DF) contains two groups of linked variables (ESP1:ESP9) and (ECRL1:ECRL9). Within ESP1:ESP9 are

[R] Lattice: Superimposing histograms with different colors and transparency effects

2010-08-13 Thread Yvonnick NOEL
Dear users, I would like to plot several histograms superimposed on the same panel with different colors, with superimposed polygons appearing with transparency effects. I also want estimated densities to appear on the same plot. For several reasons, including that I like it, I want to use the

Re: [R] Lattice: Superimposing histograms with different colors and transparency effects

2010-08-13 Thread Jorge Ivan Velez
Hi Yvonnick, Have you looked at ggplot2? There are two examples at the end of [1]. HTH, Jorge [1] http://had.co.nz/ggplot2/geom_histogram.html On Fri, Aug 13, 2010 at 4:12 PM, Yvonnick NOEL wrote: Dear users, I would like to plot several histograms superimposed on the same panel with

Re: [R] Kalman filter

2010-08-13 Thread Bruno Mourato
Take a look on this Packages: - KFTRACK - UKFSST - TRACKIT 2010/8/13 FMH kagba2...@yahoo.com Dear All, Could anyone give me a hand to suggest few packages in R to running Kalman prediction and filtration ? Thanks Fir __

  1   2   >