[R] MANOVA

2009-03-12 Thread Ding Xiao
Hi All, I have questions about MANOVA which I am still not sure if appropriately I should use it. For example I have a data set like this: BloodPressure (BP) Weight Height 120115165 125145198 15699 176 I know that BloodPressure is correlated with both

Re: [R] MANOVA

2009-03-12 Thread Simon Blomberg
You only have one response variable, so MANOVA is not appropriate. One option would be to compare BP ~ Weight + Height with BP ~ 1. That would give you a joint test of weight and height together. Since they are collinear, that should tell you the overall effect of size. There are other options,

Re: [R] Ggplot2: saving a grid with multiple plots

2009-03-12 Thread Dieter Menne
ONKELINX, Thierry Thierry.ONKELINX at inbo.be writes: I have managed to create a figure on the screen with multiple plots in it. Something like the example below. When I save that with ggsave(), only the last plot gets saved (pPath in the example) instead of the entire figure. Any suggestions

[R] e1071 SVM one-classification tune problem

2009-03-12 Thread Alfonso Torres
Hello all, I am using the e1071 SVM with the tune options for classification, which work pretty well, given the examples of using tune.svm function for classification. But I have not found any example to tune the SVM novelty detection (one-classification) parameters (gamma, cost, nu), for

[R] Removing

2009-03-12 Thread Tammy Ma
Hi All, act_2 DateDtime Hour Min Second Rep 51 2006-02-22 14:52:18 14 52 18 useractivity_act 52 2006-02-22 14:52:18 14 52 18 4 55 2006-02-22 14:52:49 14 52 49 4 57 2006-02-22 14:52:51 14 52 51

Re: [R] Ggplot2: saving a grid with multiple plots

2009-03-12 Thread ONKELINX, Thierry
Dear all, Thanks for all your responses. It looks like I was misinterpreting the capabilities of ggsave(). That can only handle the basic ggplot2 plots (which can be very elaborate). This behaviour is decribed at the end of chapter 8 in the ggplot2 book, but I missed that. Opening and closing a

[R] Removing rows

2009-03-12 Thread Tammy Ma
Hi All, act_2 DateDtime Hour Min Second Rep 51 2006-02-22 14:52:18 14 52 18 useractivity_act 52 2006-02-22 14:52:18 14 52 18 4 55 2006-02-22 14:52:49 14 52 49 4 57 2006-02-22 14:52:51 14 52 51

Re: [R] R library help files

2009-03-12 Thread Uwe Ligges
Dajiang Liu wrote: Dear All, I am writing an R library myself. The package build ok, and can be installed. But when I load the library into R using library('xyz'), then I type ?xyz for help in one of the functions named xyz as well, the following error occured, No documentation for 'xyz' in

Re: [R] who can give me some hint?

2009-03-12 Thread Simon Pickett
Hi All, act_2 DateDtime Hour Min Second Rep 51 2006-02-22 14:52:18 14 52 18 useractivity_act 52 2006-02-22 14:52:18 14 52 18 4 55 2006-02-22 14:52:49 14 52 49 4 57 2006-02-22 14:52:51 14 52 51

Re: [R] who can give me some hint?

2009-03-12 Thread Richard . Cotton
Hi All, act_2 DateDtime Hour Min Second Rep 51 2006-02-22 14:52:18 14 52 18 useractivity_act 52 2006-02-22 14:52:18 14 52 18 4 55 2006-02-22 14:52:49 14 52 49 4 57 2006-02-22 14:52:51 14 52 51

[R] who can give me some hint?

2009-03-12 Thread Tammy Ma
Hi All, act_2 DateDtime Hour Min Second Rep 51 2006-02-22 14:52:18 14 52 18 useractivity_act 52 2006-02-22 14:52:18 14 52 18 4 55 2006-02-22 14:52:49 14 52 49 4 57 2006-02-22 14:52:51 14 52 51

Re: [R] can I draw 3D plot like this using R?

2009-03-12 Thread Duncan Murdoch
On 11/03/2009 11:35 PM, Oliver wrote: hi, all I am looking at R package RGL to draw a colored mesh/surface plot like this one (from matlab). http://www.mathworks.com/access/helpdesk/help/techdoc/visualize/cbar.gif The key features I am looking for is surfaced with grid and color, but not the

[R] problem with 'abline' in a regression with repeated measures

2009-03-12 Thread Marc Carpentier
Hi everybody. I'm just learning to use R. I've got a strange problem and I couldn't find any answer to my problem. So here am I. I want to visualize a model of regression on repeated measures : 5 measures (y) by x-value (lx for log10(x) ; lxf colonn is for as.factor) ; 5 x-values. I fail to

[R] Hi, I'm working with custom slides(Cy5) and worki...

2009-03-12 Thread david david
Hi, I'm working with custom slides(Cy5) and working in the normalization of the arrays. I have three arrays (technical replicates). I have sucesfully normalized the data using vsn, however i would like to compare it to the normalization using spike in controls. My controls are annotated as

[R] RES: Removing rows

2009-03-12 Thread Leandro Marino
Hi Tammy, You can do: act_2temp - act_2[which(!duplicated(act_2[,c(1:5)])),] act_2temp[1:5,] act_2 - act_2temp rm(act_2temp) Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600

Re: [R] who can give me some hint?

2009-03-12 Thread Gabor Grothendieck
I assume the problem is to only keep those rows whose Rep value is not equal to the Rep value in the prior row. In that case just compare c(, Rep[-nr]) to Rep and use the resulting vector, ix, to select out rows. Rep - as.character(act_2$Rep) could be simplified to Rep - act_2$Rep if Rep is

Re: [R] who can give me some hint?

2009-03-12 Thread Tammy Ma
Thanks a lot for your reply. I expect a more flexible solution. Because I couldn't check that column one by one. If another Rep colum is: useractivity_act 2 2 3 3 3 4 5 5 6 useractivity_idle i should be able to write a program to make it as: useractivity_act 2 3 4 5 6 useractivity_idle

[R] regsubsets() [leaps package] - please share some good examples of use

2009-03-12 Thread Tal Galili
Hello dear R-help members, I recently became interested in using biglm with leaps, and found myself somewhat confused as to how to use the two together, in different settings. I couldn't find any example codes for the leaps() package (except for in the help file, and the examples there are not

[R] RES: RES: Removing rows

2009-03-12 Thread Leandro Marino
Sorry, act_2temp - act_2[which(!duplicated(act_2[,c(1: 6 )])),] # not 5 Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 ( (21) 8777-7907 ( lean...@cesgranrio.org.br

Re: [R] who can give me some hint?

2009-03-12 Thread Gabor Grothendieck
Its not clear what more flexible refers to. The posted solution already produces the sample output you showed. What else should it do? On Thu, Mar 12, 2009 at 8:15 AM, Tammy Ma metal_lical...@live.com wrote: Thanks a lot for your reply. I expect a more flexible solution. Because I couldn't

[R] help with loop

2009-03-12 Thread Rafael Moral
Dear useRs, I'm trying to write a loop to sum my data in the following way: (the second - the first) + (the third - the second) + (the fourth - the third) + ... for each column. So, I wrote something like this:   c - list()   for(i in 1:ncol(mydata)) {   for(j in 2:nrow(mydata)) {   c[[i]] -

Re: [R] help with loop

2009-03-12 Thread Nutter, Benjamin
Why use a loop? Try using diff() x - c(4, 19, 21, 45, 50, 73, 78, 83, 87, 94) sum(diff(x)) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Rafael Moral Sent: Thursday, March 12, 2009 9:04 AM To: r-help@r-project.org Subject: [R]

Re: [R] help with loop

2009-03-12 Thread Wacek Kusnierczyk
is your data a data frame or a matrix? do you want to compute the differences columnwise, i.e., for each column independently? consider this example: # generate and display dummy data (d = as.data.frame(replicate(3, sample(5 # compute successive differences columnwise

Re: [R] help with loop

2009-03-12 Thread Romain Francois
Hi, Try this; lapply( mydata, function(x){ sum( diff( x ) ) } ) Romain Rafael Moral wrote: Dear useRs, I'm trying to write a loop to sum my data in the following way: (the second - the first) + (the third - the second) + (the fourth - the third) + ... for each column. So, I wrote

Re: [R] help with loop

2009-03-12 Thread Richard . Cotton
I'm trying to write a loop to sum my data in the following way: (the second - the first) + (the third - the second) + (the fourth - the third) + ... for each column. This is just sum(diff(x)), or even x[length(x)] - x[1]. Regards, Richie. Mathematical Sciences Unit HSL

Re: [R] help with loop

2009-03-12 Thread Romain Francois
Well actually, what about that (Assuming mydata is a data frame) tail( mydata, 1 ) - head( mydata, 1) since: (the second - the first) + (the third - the second) + (the fourth - the third) = the last - the first Romain Rafael Moral wrote: Dear useRs, I'm trying to write a loop to sum my

Re: [R] help with loop

2009-03-12 Thread Gabor Grothendieck
This is a telescoping sum that can be calculated analytically as: (a[2] - a[1]) + ... + (a[n] - a[n-1]) = a[n] - a[1] On Thu, Mar 12, 2009 at 9:04 AM, Rafael Moral rafa_moral2...@yahoo.com.br wrote: Dear useRs, I'm trying to write a loop to sum my data in the following way: (the second -

Re: [R] help with loop

2009-03-12 Thread Jorge Ivan Velez
Dear Rafael, Perhaps: sum(diff(x)) where x is your vector. To apply above to your data set (by rows), you could use apply(mydata,1,function(x) sum(diff(x))) See ?diff, ?sum and ?apply for more information. HTH, Jorge On Thu, Mar 12, 2009 at 9:04 AM, Rafael Moral

Re: [R] help with loop

2009-03-12 Thread baptiste auguie
On 12 Mar 2009, at 13:22, richard.cot...@hsl.gov.uk wrote: I'm trying to write a loop to sum my data in the following way: (the second - the first) + (the third - the second) + (the fourth - the third) + ... for each column. This is just sum(diff(x)), or even x[length(x)] - x[1]. I think

[R] batch process file in R

2009-03-12 Thread tedzzx
Dear R experts, I have a folder names 200209 and in this folder there are many data files, such as: BA020902.txt,BA020903.txt,BA020904.txt, BA020905.txt,BA020906.txt,BA020909.txt, BA020910.txt,BA020911.txt,BA020912.txt, BA020913.txt,BA020916.txt,BA020917.txt,

[R] Randomization, line and spatial coordinates

2009-03-12 Thread PLAFF
Hi all, I would like to know how to create n equidistant random points along a multisegment line/object of class psp and to retrieve the coordinates of those generated random points. thanks P.L. -- View this message in context:

[R] How to install R-2.8.1 on AIX

2009-03-12 Thread 王峰
Hi: I can't install the R-2.8.1 on the machine IBM AIX according the instruction configuratioin(OBJECT_MODE=64). I can successfully ./configure ***, and get a Makefile. But during compiling the source code, there is some problem I can't fix it. Please tell me some tips about how to

[R] zooreg and lmrob problem (bug?)

2009-03-12 Thread Víctor Homar
Hi all and thanks for your time in advance, I can't figure out why summary.lmrob complains when lmrob is used on a zooreg object. If the zooreg object is converted to vector before calling lmrob, no problems appear. Let me clarify this with an example: library(robustbase) library(zoo)

Re: [R] Partial function application in R

2009-03-12 Thread nosek
Sorry for not answering long. After working a lot with new version of bind function I find it actually really useful. Just to avoid any possible hard-to-debug errors I try to stick to some good practices, like always specifying default values for formal parameters and calling bind with named

[R] alternative to EMV?

2009-03-12 Thread Elsaesser, Chris
I need a package that can compute missing values of n-dimensional vectors for n 2. This is a kind of interpolation, complicated in dimensions higher than 2. The idea is that I have a set of fully specified vectors (i.e., with no missing values) and I get a new vector that has one or more

[R] 'netalg' and 'netlab' packages neural networks

2009-03-12 Thread Sály Péter
Dear List, I have just started to familiarize with artificial neural networks and I find two names of packages by chance using R search. But unfortunately I can not find these packages on the CRAN. Is it possible that they were renamed? The names of the packages in question are: netalg

Re: [R] zooreg and lmrob problem (bug?)

2009-03-12 Thread Gabor Grothendieck
One can't assume an arbitrary function necessarily works with zoo objects although many do; however, for functions that are sufficiently similar to lm, like lmrob, dyn in the dyn package can transform it to work with zoo (as well as with ts and a number of other time series classes). Just preface

[R] set size of a plot

2009-03-12 Thread Maxl18
Hi, I have the following R-code: pdf(file=test.pdf) hist(rcauchy(100)) dev.off() How can I set the size of the histogram in my pdf? I tried to do with par(...) but I didn't find the right parameter yet. Thanks, Max -- View this message in context:

[R] GARCH variance equation with dummy variables

2009-03-12 Thread Brajkovic J.
I am estimating daily electricity prices using GARCH (1,1). What I would like to see is whether there is some kind of daily or seasonal effect in variance of the price series. For instance, variance of electricity prices might be different (higher) during weekdays as opposed to during weekend.

Re: [R] CI from svyquantile in survey package

2009-03-12 Thread Thomas Lumley
This is a consequence of changes made to support multiple imputation, where extracting the standard errors was needed. I will try to fix it. A work-around is to use lapply() and subset() lapply(c(E,M,H), function(s) svyquantile(~api99,subset(dclus1, stype==s), ci=TRUE,quantiles=0.5))

Re: [R] set size of a plot

2009-03-12 Thread ONKELINX, Thierry
?pdf reads: width, height the width and height of the graphics region in inches. The default values are 7. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel

Re: [R] regsubsets() [leaps package] - please share some good examples of use

2009-03-12 Thread Thomas Lumley
If you run the example from ?biglm data(trees) ff-log(Volume)~log(Girth)+log(Height) chunk1-trees[1:10,] chunk2-trees[11:20,] chunk3-trees[21:31,] a - biglm(ff,chunk1) a - update(a,chunk2) a - update(a,chunk3) summary(a) you can then do b -regsubsets(a, method=forward) summary(b) to get the

Re: [R] set size of a plot

2009-03-12 Thread Sarah Goslee
Set which size? Of the page? - then you need to specify in pdf(). Of the plot margins? - then par$mai Of something else? Then you need to be more specific about your intention. Sarah On Thu, Mar 12, 2009 at 10:05 AM, Maxl18 maximilianwoe...@hotmail.com wrote: Hi, I have the following R-code:

Re: [R] MANOVA

2009-03-12 Thread David Winsemius
Another method would be to use a summary that incorporates both as a measure of obesity, In medical investigations it is common to use the BMI which is the ratio of (weight in Kg) to (height in meters squared). Yet a third method would be to investigate for nonlinearity on the response

Re: [R] Removing

2009-03-12 Thread David Winsemius
Much simpler would be: act2[!duplicated(act2$Rep),] #use the negation of the duplicated function on $Rep and indexing DateDtime Hour Min Second Rep 51 2006-02-22 14:52:18 14 52 18 useractivity_act 52 2006-02-22 14:52:18 14 52 18 4

Re: [R] set size of a plot

2009-03-12 Thread Christos Hatzis
See ?pdf and its width and height arguments. Also if you want to have the graph centered on a standard page, there are additional arguments to help you achieve that effect: pdf(test.pdf, height=5, width=5, paper=letter, pagecentre=TRUE) hist(rcauchy(100)) dev.off() -Christos -Original

Re: [R] full screen graph, and close x11

2009-03-12 Thread Eik Vettorazzi
Hi, see ?dev.off but I think (guessing you use a windows system), you would be better of in using win.metafile() instead of x11() in initiating the graph, see ?win.metafile There is no need to show all 100+ graphs on your display if you actually want them in files. hth. BaKaLeGuM schrieb:

[R] model simplification in lme

2009-03-12 Thread Menelaos Stavrinides
Model simplification in lme Pinheiro and Bates suggest that model simplification of fixed effects in lme with anova (model,model2) is anticonservative. What is the best way to simplify a model in lme? Testing the p value for each fixed factor with anova (model, type=marginal) and removing it if it

[R] read.xls and name of worksheet

2009-03-12 Thread Juergen Rose
Hi, I would like to some excel files with some worksheets. I tried this with the following R script: library(gdata) i-1 rc-0 while(rc != try-error) { wksh-try(read.xls(cluster-microarray-FW.xls,sheet=i,verbose=TRUE,perl=perl)) rc-class(wksh) print(sprintf(--- i=%2d rc=%s

Re: [R] read.xls and name of worksheet

2009-03-12 Thread Gabor Grothendieck
Here is a program that will get a list of the sheet names and then read in the indicated name. Modify to suit. library(rcom) xls - C:\\test.xls oxl - comCreateObject('Excel.Application') comSetProperty(oxl, Visible, TRUE) owb - comGetProperty(oxl, Workbooks) ob - comInvoke(owb, Open, xls)

Re: [R] alternative to EMV?

2009-03-12 Thread David Winsemius
If I understand your question and if I understood Dr Harrell's description of the Hmisc/Design packages capabilities, this should all be available. I have been blessed with a dataset so large and with so relatively few missing values that I have not yet needed to put his methods into

[R] eps/pdf write help

2009-03-12 Thread Mohan Singh
I am trying to print graphs as pdf's or eps in a for loop, but I can't seem to get it right Either it prints only a single eps graph (overwrites) or when I use #pdf(paste(i,.pdf, sep=)) .. it prints all pdf's but they are empty Can someone suggest which method shud I use for such.

Re: [R] Easy Recall to get ls(..., all.names=TRUE)?

2009-03-12 Thread Szumiloski, John
-Original Message- From: Rolf Turner [mailto:r.tur...@auckland.ac.nz] Sent: Wednesday, 11 March, 2009 5:09 PM To: Szumiloski, John Cc: r-help@r-project.org Subject: Re: [R] Easy Recall to get ls(..., all.names=TRUE)? On 12/03/2009, at 3:16 AM, Szumiloski, John wrote: Dear useRs,

[R] help with predict and plotting confidence intervals

2009-03-12 Thread Michael Denslow
Dear R help, This seems to be a commonly asked question and I am able to run examples that have been proposed, but I can't seems to get this to work with my own data. Reproducible code is below. Thank you in advance for any help you can provide. The main problem is that I can not get the

Re: [R] matrix multiplication, tensor product, block-diagonal and fast computation

2009-03-12 Thread Charles C. Berry
On Wed, 11 Mar 2009, Camarda, Carlo Giovanni wrote: Dear R-users, I am searching to the best way to compute a series of n matrix multiplications between each matrix (mXm) in an array (mXmXn), and each column of a matrix (mXn). Please find below an example with four possible solutions. The

Re: [R] R-help: grep in for loop using index - doesn't work

2009-03-12 Thread baptiste auguie
Hi, your example is quite messy (neither reproducible or minimal). I think you could try the following, mdf - data.frame(1:3) names(mdf) - 147 i - 147 mdf[ as.character(i) ] Hope this helps, baptiste On 11 Mar 2009, at 22:34, Mohan Singh wrote: Hi everyone I am trying to use

Re: [R] Is there any difference between - and =

2009-03-12 Thread Jens Oehlschlägel
Sean, would like to receive expert opinion to avoid potential trouble [..] i think the following is the most secure way if one really really has to do assignment in a function call f({a=3}) and if one keeps this convention, - can be dropped altogether. secure is relative, since due to

Re: [R] help with predict and plotting confidence intervals

2009-03-12 Thread David Winsemius
On Mar 12, 2009, at 11:14 AM, Michael Denslow wrote: Dear R help, This seems to be a commonly asked question and I am able to run examples that have been proposed, but I can't seems to get this to work with my own data. Reproducible code is below. Thank you in advance for any help you

Re: [R] eps/pdf write help

2009-03-12 Thread Philipp Pagel
On Thu, Mar 12, 2009 at 03:06:30PM +, Mohan Singh wrote: I am trying to print graphs as pdf's or eps in a for loop, but I can't seem to get it right Either it prints only a single eps graph (overwrites) or when I use #pdf(paste(i,.pdf, sep=)) .. it prints all pdf's but they are

[R] runs.test question

2009-03-12 Thread Ista Zahn
Hi everyone, I have data from an experiment in which human participants were instructed to generate a random sequence of yes/no answers under 4 different conditions. I want to test how successful they were in doing this. More specifically, I want to test the null hypothesis that the 4 conditions

Re: [R] help with predict and plotting confidence intervals

2009-03-12 Thread David Winsemius
On Mar 12, 2009, at 11:45 AM, David Winsemius wrote: On Mar 12, 2009, at 11:14 AM, Michael Denslow wrote: # I am not sure how to get the lines to draw correctly here matlines(pred.frame$a,pp, lty=c(1,2,2),col=black) The x values are your sequence whereas the y values are in the

[R] Seemingly unrelated model with spatial processes

2009-03-12 Thread ArunPrasad
Hello everyone, Do we have package in R which will estimates the parameter in Seemingly Unrelated Spatial Regression Model? Any help would be appreciated. Thanks Arun -- View this message in context:

Re: [R] batch process file in R

2009-03-12 Thread Derek Norton
If these are the only files in the directory, then you might try... (File paths will need to change if the folder 200209 isn't in the working directory) fpath - ./200209 a - list.files(fpath) for(i in 1:length(a)){ assign(paste(y,i,sep=),read.table(paste(fpath,a[i],sep=/))) } Another option

[R] How to replace a pair of observations in a matrix?

2009-03-12 Thread WXE83
Dear all, I did this replacement below and its work for the first case but not in the second case! Please tell me what's wrong with the second case. Case 1: m [,1] [,2] [1,]14 [2,]25 [3,]36 l [,1] [,2] [1,]9 10 matric1-replace(m,m[3,],l)

[R] debug

2009-03-12 Thread Tammy Ma
Hi, All I have so many files in my directory. I got the following error. At this time, I couldn't use debug() to check error one by one because so many files getting invloved. How can I get some idea about my error?? . Skipping book_log-20060222T143612.txt Skipping

Re: [R] can I draw 3D plot like this using R?

2009-03-12 Thread Oliver
Thank you all for the suggestions and answers. Oliver On Mar 12, 6:51 am, Duncan Murdoch murd...@stats.uwo.ca wrote: On 11/03/2009 11:35 PM, Oliver wrote: hi, all I am looking at R package RGL to draw a colored mesh/surface plot like this one (from matlab).

Re: [R] debug

2009-03-12 Thread Duncan Murdoch
Tammy Ma wrote: Hi, All I have so many files in my directory. I got the following error. At this time, I couldn't use debug() to check error one by one because so many files getting invloved. How can I get some idea about my error?? The usual advice: simplify the problem until it's

[R] nested logit estimation

2009-03-12 Thread justin bem
Dear all, Is there a function to fit nested logit available somewhere ? Sincerly  Justin BEM BP 1917 Yaoundé Tél (237) 99597295 (237) 22040246 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] avoiding termination of nls given convergence failure

2009-03-12 Thread Bill Shipley
Hello. I have a script in which I repeatedly fit a nonlinear regression to a series of data sets using nls and the port algorithm from within a loop. The general structure of the loop is: for(i in 1:n){ … extract relevant vectors of dependent and independent variables … … estimate starting

Re: [R] avoiding termination of nls given convergence failure

2009-03-12 Thread Joshua Reich
Hi Bill, You should have a look at the try() function that lets you enclose an expression and handle failure in a way that prevents the entire execution from halting. Josh On Thu, Mar 12, 2009 at 1:13 PM, Bill Shipley bill.ship...@usherbrooke.cawrote: Hello. I have a script in which I

Re: [R] avoiding termination of nls given convergence failure

2009-03-12 Thread Gabor Grothendieck
If the goal here is to repeatedly run a particular model from different starting values then the nls2 package will do that for you. On Thu, Mar 12, 2009 at 2:13 PM, Bill Shipley bill.ship...@usherbrooke.ca wrote: Hello.  I have a script in which I repeatedly fit a nonlinear regression to a

Re: [R] avoiding termination of nls given convergence failure

2009-03-12 Thread Ravi Varadhan
?try For example, for (i in 1:n) { try (fit - nls(...), silent=TRUE) if (class(fit) != try-error) dowhateverthatneedstobedonewiththeresults else fit - NA } Ravi. --- Ravi Varadhan, Ph.D. Assistant

[R] Cross-validation - lift curve

2009-03-12 Thread Eric Siegel
Hi all, I'd like to do cross-validation on lm and get the resulting lift curve/table (or, alternatively, the estimates on 100% of my data with which I can get lift). If such a thing doesn't exist, could it be derived using cv.lm, or would we need to start from scratch? Thanks! -- Eric Siegel,

Re: [R] who can give me some hint?

2009-03-12 Thread William Dunlap
I think I answered a very similar question from you yesterday but perhaps the mail went astray. The subject line is not informative. It may make it easier to think about if you use a function like isFirstInRun - function(x) c(TRUE, x[-1]!=x[-length(x)] Given a vector x (without NA's in it) it

Re: [R] Removing

2009-03-12 Thread Patrick Burns
Simpler, but maybe wrong. Not duplicated was my first response as well, but then I began wondering if the question implied globally duplicated or duplicated within subgroups. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide

Re: [R] help with predict and plotting confidence intervals

2009-03-12 Thread Michael Denslow
Thank you for you help Dr. Winsemius. The problem seems to stem from the fact that I have used the incorrect name in the prediction dataframe. The following code seems to work correctly. Thank you again, Michael wt.data - data.frame(code = factor(LETTERS[1:24]), area =

[R] R grep gsub issue - sign seems to be causing an issue...

2009-03-12 Thread Jason Rupert
I would like to use grep and gsub to manipulate a vector to make the names used consistent, i.e. reduce a level or two. However, here is what I found when I attempted to use grep and gsub: tmp_test-c(House 1 Plot Plus +100,House 2 Plot Plus +100,House 3 Plot Plus -100,House 4 Plot Plus

Re: [R] Removing

2009-03-12 Thread David Winsemius
True, I suppose. The specification from Ma could have been more explicit. Should she want to only have duplicates in sequence, then perhaps the use of construction within the rle function would be useful. act2[ act2$Rep[-1] != act2$Rep[-length(act2$Rep)], ] DateDtime Hour Min

[R] New York R Meetup

2009-03-12 Thread Joshua Reich
Hi, After hearing good things about the R community over on the west coast, I have started a New York based R meetup group. We intend to have our first get together on Thursday April 2nd, at 7pm. For more details pop on over to http://meetup.com/nyhackr Regards, Josh -- Joshua Reich 646 256

[R] stats lm() function

2009-03-12 Thread Paul Hermes
Hi, Im using the lm() function where the formula is quite big (300 arguments) and the data is a frame of 3000 values. This is running in a loop where in each step the formula is reduced by one argument, and the lm command is called again (to check which arguments are useful) . This takes

[R] stats lm() function

2009-03-12 Thread ph84
Hi, Im using the lm() function where the formula is quite big (300 arguments) and the data is a frame of 3000 values. This is running in a loop where in each step the formula is reduced by one argument, and the lm command is called again (to check which arguments are useful) . This takes 1-2

Re: [R] R grep gsub issue - sign seems to be causing an issue...

2009-03-12 Thread Duncan Murdoch
Jason Rupert wrote: I would like to use grep and gsub to manipulate a vector to make the names used consistent, i.e. reduce a level or two. This is dangerous: grep and gsub use regular expressions, so a lot of characters (see ?regexp for the list) have special meanings. For the kind of

Re: [R] GARCH SIMULATION

2009-03-12 Thread Jurica
You should try installing fGarch package. Then you can simulate various garch models using garchsim command. Hope it help. jurica SUMANTA BASAK-4 wrote: Hi All, I,m trying to do a GARCH simulation in R 2.3.0 release in Windows XP. I've seen garchsim function but that is for garch

Re: [R] stats lm() function

2009-03-12 Thread Dimitris Rizopoulos
yes, indeed, you can certainly speed things up, by just changing the design matrix X and feeding it back to lm.fit(). In addition, if you just need the least squares estimates, then you gain a bit more by using constructs of the form: XtX - crossprod(X) Xty - crossprod(X, y) betas -

Re: [R] stats lm() function

2009-03-12 Thread Ravi Varadhan
Look at: ?update For example: lm.obj - lm (y ~ x1 + ... + x300) lm.obj1 - update(lm.obj, . ~ . - x1) lm.obj2 - update(lm.obj1, . ~ . - x2) Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine

Re: [R] Removing

2009-03-12 Thread David Winsemius
On Mar 12, 2009, at 3:02 PM, David Winsemius wrote: True, I suppose. The specification from Ma could have been more explicit. Should she want to only have duplicates in sequence, then perhaps the use of construction within the rle function would be useful. act2[ act2$Rep[-1] !=

Re: [R] stats lm() function

2009-03-12 Thread David Winsemius
I think you will find that many readers of this list would rather try to dissuade you from this misguided strategy. You are unlikely to get to a sensible solution in using step-down procedures with this sort of situation (large number of predictors with modest size of data). -- David

Re: [R] R grep gsub issue - sign seems to be causing an issue...

2009-03-12 Thread Prof Brian Ripley
On Thu, 12 Mar 2009, Duncan Murdoch wrote: Jason Rupert wrote: I would like to use grep and gsub to manipulate a vector to make the names used consistent, i.e. reduce a level or two. This is dangerous: grep and gsub use regular expressions, so a lot of characters (see ?regexp for the

[R] Writing xls - multiple sheets

2009-03-12 Thread Ferry
Hi, Is there a package I can use to write to multiple sheets on xls file, other than using the paid version of xlsReadWrite package (xlsReadWritePro)? Thank you, Ferry __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] portable R editor

2009-03-12 Thread Werner W.
Unfortunately, the suggested way with JauntePE does not work completely. Maybe I have found a better alternative now: There is a little free application by Sysinternals (now owned by MS) which can create junction points, i.e. a system link to a directory under Windows. It is available here:

Re: [R] Is there any difference between - and =

2009-03-12 Thread Wacek Kusnierczyk
Jens Oehlschlägel wrote: Sean, would like to receive expert opinion to avoid potential trouble [..] i think the following is the most secure way if one really really has to do assignment in a function call f({a=3}) and if one keeps this convention, - can be dropped

[R] How to find maximum values on the density function of a random variable

2009-03-12 Thread guox
I would like to find the maximum values on the density function of a random variable. For example, I have a random variable rv - rbinom(1,1,0.1) + rnorm(1) Its density function is given by density(rv) and can be displayed by plot(density(rv)). How to calculate its maximum values? A

Re: [R] Writing xls - multiple sheets

2009-03-12 Thread markleeds
I think that Gabor sent something earlier today ( or atleast something related ) so check the archives for his solution. On Thu, Mar 12, 2009 at 4:29 PM, Ferry wrote: Hi, Is there a package I can use to write to multiple sheets on xls file, other than using the paid version of

Re: [R] Error.bars

2009-03-12 Thread Frank E Harrell Jr
Sueli Rodrigues wrote: Hi, I'm studying the Michael J. Crawley book (Statistics An Introduction using R)and I'm trying to reproduce one example (page 168) for plot a barplot with error bars, but when I put the function I receive the following message. Please, could someone told me what's wrong?

[R] setdiff for data.frames?

2009-03-12 Thread Jason Rupert
I have two data.frames. One is the subset of the other. I need to determine what rows were removed from the superset data.frame to form the subset data.frame. I was hoping to turn up functionality similar to setdiff for data.frames, but did not have any luck. It seems I need to find a

[R] FW: Re: Writing xls - multiple sheets

2009-03-12 Thread markleeds
Jorge was kind enough to point out that I made a mistake in referencing gabor's solution. See below. Thanks Jorge. Begin forwarded message Subject: Re: [R] Writing xls - multiple sheets Date: 3/12/2009 6:03:13 PM From: Jorge Ivan Velez To: markle...@verizon.net Hi Mark,

Re: [R] setdiff for data.frames?

2009-03-12 Thread Gabor Grothendieck
Try this: library(sqldf) BODsub - BOD[1:3,] sqldf(select * from BOD except select * from BODsub) For more see: http://sqldf.googlecode.com On Thu, Mar 12, 2009 at 5:58 PM, Jason Rupert jasonkrup...@yahoo.com wrote: I have two data.frames. One is the subset of the other.  I need to determine

Re: [R] Writing xls - multiple sheets

2009-03-12 Thread Gabor Grothendieck
That was to read worksheet names but its true that the same packages rcom and rdcom can control Excel and therefore write spreadsheets. On Thu, Mar 12, 2009 at 5:52 PM, markle...@verizon.net wrote:  I think that Gabor sent something earlier today ( or atleast something related ) so check the

[R] Unable to run smoother in qplot() or ggplot() - complains about knots

2009-03-12 Thread Christopher David Desjardins
I get the following error when I run qplot() qplot(grade, read,data = hhm.long.m, geom = c(point, smooth)) Error in smooth.construct.cr.smooth.spec(object, data, knots) : x has insufficient unique values to support 10 knots: reduce k. I am not sure how to tackle this problem. When I take a

[R] Time-Ordered Clustering

2009-03-12 Thread Prew, Paul
Hello All, Does anyone know of a package that performs constraint-based clusters? Ideally the package could perform Time-Ordered Clustering, a technique applied in a recent journal article by Runger, Nelson, Harnish (using MS Excel). Quote, in our specific implementation of constrained

  1   2   >