Re: [R] how does one print code

2010-04-09 Thread David.Epstein
I downloaded the code, as Duncan Murdoch suggested. I also used sink() as suggested by others and found that the two methods gave identical results. I then fixed the bug in a private file and tried it out on a number of examples. It now seems to work fine, as far as I can tell. From CRAN, I

[R] SSH Through R Script

2010-04-09 Thread afoo
Hi, I am trying to SSH to a remote server through R script. In other words, I would like to know how I can get a SSH connection to the remote server and then execute commands on that server with the R script. So in bash, I would normally type ssh -lusername remoteserver.com; press enter and

Re: [R] general linear hypothesis testing for manova model

2010-04-09 Thread Peter Dalgaard
John Fox wrote: Dear Philippe, The linear.hypothesis() function in the car package should do what you want. I hope this helps, John Also, at least in many cases, anova.mlm in the base package. The catch is that the L of the LBM==0 has to correspond to a linear model reduction. The M is

[R] How to get the penalty matrix for natural cubic spline?

2010-04-09 Thread Yan Li
Hi, all I am trying to get the basis matrix and penalty matrix for natural cubic splines. In the splines package of R,ns can generate the B-spline basis matrix for a natural cubic spline. How can I get the basis matrix and penalty matrix for natural cubic spline. Thanks a lot! Lee

Re: [R] How to use tapply for quantile

2010-04-09 Thread Patrick Hausmann
Hi James, I don't know how to solve it with tapply (something with split I think..), but you could use plyr (from Hadley Wickham). library(plyr) # Generate some data set.seed(321) myD - data.frame( Place = sample(c(AWQ,DFR, WEQ), 10, replace=T), Light = sample(LETTERS[1:2], 15,

Re: [R] xts off by one confusion or error

2010-04-09 Thread Tim Coote
I find the following even more confusing as I thought that xts was a subclass of zoo and I'd expected that the conversion would have been more transparent aggregate (vv, as.yearmon(index(vv)), mean) Feb 2010 6.08 xts (aggregate (vv, as.yearmon(index(vv)), mean)) x Jan 2010 6.08

Re: [R] Biplot for PCA using labdsv package

2010-04-09 Thread Jari Oksanen
Dilys Vela dilysvd at gmail.com writes: Hi everyone, I am doing PCA with labdsv package. I was trying to create a biplot graphs in order to observe arrows related to my variables. However when I run the script for this graph, the console just keep saying: *Error in nrow(y) : element 1

Re: [R] a small question about R with Winbugs

2010-04-09 Thread Bob O'Hara
On 8 April 2010 22:58, dcflyer dcfl...@gmail.com wrote: I try to do a test for dirichlet process for Multivariate normal, but Winbugs always says expected multivariate node, does that mean I miss something at initialization? I will really appreciate the help to solve this problem Here is

[R] Installation of R on a MIPS netbook

2010-04-09 Thread Frédéric Chiroleu
Hi everybody, I received a question from a collegue (see below) and I searched on the site for information to answer him Writing in Search mips installation I found the page R installation and administration, and specifically the section 2 on Unix-alikes systems. I send him too the section

Re: [R] Accessing elements of plm outputs

2010-04-09 Thread Millo Giovanni
Dear all, just to confirm that as far as I know (Yves please correct me if I'm wrong) Achim's fix is currently the way to go. The sum-of-squares statistics part of 'plm' outputs is currently quite minimal and due for some extension. Cases like Eduardo's give us a sample of what the useRs

[R] fill in values between rollapply

2010-04-09 Thread Brad Patrick Schneid
Hi, Sorry ahead of time for not including data with this question. Using rollapply to calculate mean values for 5 day blocks, I'd use this: Roll5mean - rollapply(data, 5, mean, by=5, align = c(left)) My question is, can someone tell me how to fill in the days between each of these means with

[R] How to replace all non-maximum values in a row with 0

2010-04-09 Thread burgundy
Hi, I would like to replace all the max values per row with 1 and all other values with 0. If there are two max values, then 0 for both. Example: from: 2 3 0 0 200 30 0 0 2 50 0 0 3 0 0 0 0 8 8 0 to: 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 Thanks! -- View this

Re: [R] How to replace all non-maximum values in a row with 0

2010-04-09 Thread Owe Jessen
Am 09.04.2010 10:04, schrieb burgundy: Hi, I would like to replace all the max values per row with 1 and all other values with 0. If there are two max values, then 0 for both. Example: from: 2 3 0 0 200 30 0 0 2 50 0 0 3 0 0 0 0 8 8 0 to: 0 0 0 0 1 0 0 0 0 1 0 0 1 0

Re: [R] fill in values between rollapply

2010-04-09 Thread Dieter Menne
Brad Patrick Schneid wrote: If this doesn't make sense, I will clarify and provide data for an example. Which is always a good idea. Dieter -- View this message in context: http://n4.nabble.com/fill-in-values-between-rollapply-tp1816885p1819092.html Sent from the R help mailing list

[R] NAs are not allowed in subscripted assignments

2010-04-09 Thread Paul Chatfield
I'm trying to assign NAs to values that satisfy certain conditions (more complex than shown below) and it gives the right result, but breaks the loop having done the first one viz: new-c(rep(5,4),6) for (i in 1:6) {new[new[i]5.5][i]-NA} gives the correct result, though an error message appears

[R] terminating function

2010-04-09 Thread Covelli Paolo
Hi everyone, I 'm building a function, in the middle it controls the sign of a variable x. If x 0 the function write a warning (Error: negative value!). At this point I want the function stops without execute the remaining code. How can I do to terminate the function before your ending?

Re: [R] How to replace all non-maximum values in a row with 0

2010-04-09 Thread ONKELINX, Thierry
It can be done faster and more elegant with apply and rowSums rows - 10 A - matrix(rpois(n = rows * 20, lambda = 100), nrow = rows) A[4, c(1,3)] - 1000 system.time({ y - t(apply(A, 1, function(z){ 1 * (z == max(z)) })) y[rowSums(y) 1, ] - 0 })

Re: [R] NAs are not allowed in subscripted assignments

2010-04-09 Thread Alain Guillet
Maybe you can withdraw the [i] in your code... for (i in 1:6) + {new[new[i]5.5]-NA} new [1] 5 5 5 5 NA Alain On 09-Apr-10 11:23, Paul Chatfield wrote: I'm trying to assign NAs to values that satisfy certain conditions (more complex than shown below) and it gives the right result, but

Re: [R] terminating function

2010-04-09 Thread Alain Guillet
Hi, Look at the function stop which does what you want. ?stop Alain On 09-Apr-10 11:27, Covelli Paolo wrote: Hi everyone, I 'm building a function, in the middle it controls the sign of a variable x. If x 0 the function write a warning (Error: negative value!). At this point I want the

Re: [R] NAs are not allowed in subscripted assignments

2010-04-09 Thread Alain Guillet
Sorry I forgot to add that you don't need the for loop: new[new5.5] - NA new [1] 5 5 5 5 NA Alain On 09-Apr-10 11:23, Paul Chatfield wrote: new-c(rep(5,4),6) for (i in 1:6) {new[new[i]5.5][i]-NA} -- Alain Guillet Statistician and Computer Scientist SMCS - IMMAQ - Université

Re: [R] NAs are not allowed in subscripted assignments

2010-04-09 Thread Eik Vettorazzi
Hi Paul, what's wrong with new[new5.5]-NA ? Btw. your variable new has a length of 5 not 6. hth. Am 09.04.2010 11:23, schrieb Paul Chatfield: I'm trying to assign NAs to values that satisfy certain conditions (more complex than shown below) and it gives the right result, but breaks the loop

Re: [R] Accessing elements of plm outputs

2010-04-09 Thread Eduardo Marinho
Thank you Achim! It worked perfectly! And to be honest with you, I'm not really concerned by the fact it looks dirty. So, many thanks!! Giovanni and Yves, it would be great if one could also have on the output the R-squared decomposition (within, between and overall) that is provided by STATA.

[R] error bars on barplot

2010-04-09 Thread Samantha Reynolds
Hi I was hoping someone might be able to help me I have this data: birdid timetaken numvisits ptachchoice time bold 1087 810 1 AM0 108728 6 1 PM0 108713 3 2 AM0 1087 121 0

Re: [R] plm package twoways effect problem

2010-04-09 Thread seral
well thanks anyway even just for replying, i understand the lack of information causes no response... but if no one tells me that they need more information how could i send. anyway here more information about the procedure that i am applying to define the model after reading and attaching my

Re: [R] bootstrap confidence intervals, non iid

2010-04-09 Thread Kay Cichini
hi glen, i need conf.intervals for blocked data, as described in the first place. i've learned in the meantime, that the boot() function can handle this. i had to formulate the function for the boot command, put sites to the strata argument and resample from each subsetted level of the

Re: [R] SSH Through R Script

2010-04-09 Thread Jonathan Baron
You might try setting up ssh so that you do not need a password. See man ssh-keygen In essence, you make a key for the machine you are on with (for example): ssh -t dsa which produces a public and a private key. You upload the public key to remoteserver.com, and put it in your .ssh directory

Re: [R] erasing an area of a graph

2010-04-09 Thread Jim Lemon
On 04/09/2010 04:51 AM, Terry Therneau wrote: I have a case where the easiest way to draw a particular symbol would be to draw something a little bigger, and then use polygon(... , col=0) to erase the extra stuff. Just how to do this best when par('bg') = 'transparent' is, however, eluding me.

[R] computation of dispersion parameter in quasi-poisson glm

2010-04-09 Thread Sven Garbade
Hi list, can anybody point me to the trick how glm is computing the dispersion parameter in quasi-poisson regression, eg. glm(...,family=quasipoisson)? Thanks regards, Sven __ R-help@r-project.org mailing list

[R] How to run Shapiro-Wilk test for each grouped variable?

2010-04-09 Thread Iurie Malai
I want to run Shapiro-Wilk test for each variable in my dataset, each grouped by variable groupFactor. I have these working commands: data.n-names(data) # put names into a vector called data.n by(eval(parse(text=(paste(data,data.n[3],sep=$, data$factor, shapiro.test) #run shapiro.test

Re: [R] computation of dispersion parameter in quasi-poisson glm

2010-04-09 Thread Achim Zeileis
On Fri, 9 Apr 2010, Sven Garbade wrote: Hi list, can anybody point me to the trick how glm is computing the dispersion parameter in quasi-poisson regression, eg. glm(...,family=quasipoisson)? It's the sum of squared Pearson residuals divided by the residual degrees of freedom. For example:

Re: [R] error bars on barplot

2010-04-09 Thread Jim Lemon
On 04/09/2010 08:55 PM, Samantha Reynolds wrote: Hi I was hoping someone might be able to help me I have this data: birdid timetaken numvisits ptachchoice time bold 1087 810 1 AM0 108728 6 1 PM0 108713

[R] Combining ggplot2 objects and/or extracting layers

2010-04-09 Thread Marshall Feldman
Hi, Other then rebuilding the plots, is there any way either (1) to combine existing ggplot2 plots or (2) to extract a layer from an existing plot so that it can be added to another? Thanks. -- Dr. Marshall Feldman, PhD Director of Research and Academic Affairs Center for Urban Studies

Re: [R] error bars on barplot

2010-04-09 Thread Johannes Graumann
Jim Lemon wrote: On 04/09/2010 08:55 PM, Samantha Reynolds wrote: Hi I was hoping someone might be able to help me I have this data: birdid timetaken numvisits ptachchoice time bold 1087 810 1 AM0 108728 6 1 PM0

Re: [R] computation of dispersion parameter in quasi-poisson glm

2010-04-09 Thread Prof Brian Ripley
On Fri, 9 Apr 2010, Sven Garbade wrote: Hi list, can anybody point me to the trick how glm is computing the dispersion parameter in quasi-poisson regression, eg. glm(...,family=quasipoisson)? It isn't. glm() does not need (and does not compute) the dispersion parameter. summary.glm will

Re: [R] Combining ggplot2 objects and/or extracting layers

2010-04-09 Thread hadley wickham
Other then rebuilding the plots, is there any way either (1) to combine existing ggplot2 plots or (2) to extract a layer from an existing plot so that it can be added to another? Not really, although you can always pull apart the plot components. Can you give an example of what you are trying

Re: [R] NAs are not allowed in subscripted assignments

2010-04-09 Thread Paul Chatfield
Thank you – that’s sorted it. Trying to make things too complicated! J From: Alain Guillet-2 [via R] [mailto:ml-node+1819104-1154170184-120...@n4.nabble.com] Sent: 09 April 2010 10:34 To: Paul Chatfield Subject: Re: NAs are not allowed in subscripted assignments Maybe you can

[R] Beyond reshape: automatically streamlining data

2010-04-09 Thread Marshall Feldman
Hello, I've been very impressed by the reshape package and how easy it makes reorganizing statistical data structures. This makes me wonder if there's another package out there that addresses another set of tasks that one often does when preparing data for analysis. For any particular set

Re: [R] Okay, here is what I am doing

2010-04-09 Thread satu
Dear Romain, I am working with a PC with Windows-XP I do have Rtools installed and running the code you propose, this is what I get as a result: code - '#include Rdefines.h\nSEXP f(){\n return R_NilValue ; }' writeLines( code, test.c ) dyn.load( test.so ) Error in inDL(x, as.logical(local),

Re: [R] C-index and Cox model

2010-04-09 Thread Terry Therneau
Bessy wrote: Dear all R users, I am building a Cox PH model on a small dataset. I am wondering how to measure the predictive power of my cox model? Normally the ROC curve or Gini value are used in logistic regression model. Is there any similar measurement suitable for Cox model? Also if

Re: [R] How to run Shapiro-Wilk test for each grouped variable?

2010-04-09 Thread David Winsemius
On Apr 9, 2010, at 8:16 AM, Iurie Malai wrote: I want to run Shapiro-Wilk test for each variable in my dataset, each grouped by variable groupFactor. I have these working commands: data.n-names(data) # put names into a vector called data.n by(eval(parse(text=(paste(data,data.n[3],sep=$,

Re: [R] error bars on barplot

2010-04-09 Thread hadley wickham
bar.err (agricolae) plotCI (gplots) xYplot (Hmisc) error.bars (psych) dispersion (plotrix) plotCI (plotrix) Not to mention: http://biostat.mc.vanderbilt.edu/wiki/Main/DynamitePlots Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University

Re: [R] I can´t run the example shown in the inline pa ckage

2010-04-09 Thread Romain Francois
What happened to the line that contained R CMD SHLIB ? This is the bit that compiles the code. On windows (you were asked to tell us that you are running windows, both through the posting guide and from my previous email) you need to install the same tools that one needs for building a

Re: [R] How to run Shapiro-Wilk test for each grouped variable?

2010-04-09 Thread Ivan Calandra
Hi, Maybe you should change the 3 in the loop with r like: for (r in 3:18) { by(eval(parse(text=(paste(data,data.n[r],sep=$, data$groupFactor, shapiro.test) } I think it should work, if not, I have already a similar script for that. HTH, Ivan Le 4/9/2010 15:17, David Winsemius a écrit :

Re: [R] How to run Shapiro-Wilk test for each grouped variable?

2010-04-09 Thread David Winsemius
On Apr 9, 2010, at 9:39 AM, Ivan Calandra wrote: Hi, Maybe you should change the 3 in the loop with r like: for (r in 3:18) { by(eval(parse(text=(paste(data,data.n[r],sep=$, data $groupFactor, shapiro.test) } I think it should work, if not, I have already a similar script for that.

Re: [R] Combining ggplot2 objects and/or extracting layers

2010-04-09 Thread Marshall Feldman
Hi Hadley, Thanks for the terrific package! If you'd like I could give you my code, but conceptually what I'm trying to do is pretty simple. The chart on this page

Re: [R] How to run Shapiro-Wilk test for each grouped variable?

2010-04-09 Thread Iurie Malai
Thank you, David! Here is the code to read my file: data - read.table(data.txt, header=TRUE, sep=;, na.strings=NA, dec=., strip.white=TRUE) Jorge Ivan Velez gave me a working solution, but I am ready to learn yours to. Iurie 2010/4/9 David Winsemius dwinsem...@comcast.net: OK, we have the

Re: [R] Data manipulation problem

2010-04-09 Thread moleps
In the end after going at it from scratch...This worked out allright... ##set up data age.cat-seq(0,100,10) year-(1953:(1953+55)) dat.vec-sample(1:10,(length(age.cat)*length(year))) dat.matrix-matrix(dat.vec,c(length(age.cat),length(year))) rownames(dat.matrix)-age.cat

Re: [R] How to run Shapiro-Wilk test for each grouped variable?

2010-04-09 Thread Iurie Malai
Thank you very much, Jorge! Your example worked for me. Here is the code: d - data.frame(data$groupFactor, data[2:17]) d # p-values for the shapiro test (by levels of groupFactor) with(d, aggregate(d[,-1], list(d[,1]), FUN = function(x) shapiro.test(x)$p.value)) Iurie 2010/4/9 Jorge Ivan Velez

Re: [R] Beyond reshape: automatically streamlining data

2010-04-09 Thread Steve Lianoglou
Hi Marshall, On Fri, Apr 9, 2010 at 8:59 AM, Marshall Feldman ma...@uri.edu wrote: ... For any particular set of analyses, one typically recodes variables and deletes cases and variables. It would be really nice to have a package that, for example, if one selected cases from a larger data set

[R] Ranking correlation with R

2010-04-09 Thread David Nemer
Hey Everyone, Im fresh new in R, and Im supposed to write a code to give me a correlation between two rankings. So I have two ranking lists, which contain file names, e.g.: Ranking list 1: file1.java file3.java file2.java Ranking list 2: fiile2.java file4.java file1.java I need to see how much

Re: [R] How to replace all non-maximum values in a row with 0

2010-04-09 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of ONKELINX, Thierry Sent: Friday, April 09, 2010 2:25 AM To: jes...@econinfo.de; r-help@r-project.org Subject: Re: [R] How to replace all non-maximum values in a row with 0 It

[R] Dallas R Users Group has a Yahoo Group for signup now

2010-04-09 Thread Larry D'Agostino
If you are interested in joining the Dallas RUG please go to the following link to show your interest and get things started. http://tech.groups.yahoo.com/group/Dallas_RUG/ My first thought would to have some informal meet ups at some local Dallas locations to discuss overall goals, ideas,

[R] garch estimation with exogenouse variables

2010-04-09 Thread Changyou Sun
Hello All, I need to estimate a GARCH model. The mean equation contains exogenous variables like Y = B * X + et. I understand the garch function in tseries package can handle univariate model, and garchFit in fGarch can handle ARMA specification. Is there any function that can handle exogenous

Re: [R] How to get the penalty matrix for natural cubic spline?

2010-04-09 Thread Frank E Harrell Jr
Yan Li wrote: Hi, all I am trying to get the basis matrix and penalty matrix for natural cubic splines. In the splines package of R,ns can generate the B-spline basis matrix for a natural cubic spline. How can I get the basis matrix and penalty matrix for natural cubic spline. Thanks a lot!

Re: [R] SSH Through R Script

2010-04-09 Thread Don MacQueen
When I do what you're describing, I get prompted for my password: system('ssh -l usernm rmthost') use...@rmthost's password: After I enter my password, nothing seems to happen. But if I hit ctrl-c then I get a command line prompt, and it turns out that it's a shell prompt on the

Re: [R] Ranking correlation with R

2010-04-09 Thread Joshua Wiley
Dear David, Are the rankings the numbers? Like List 1: 1 3 2 If so you should be able to do it fairly easily with cor() If you have a lot of file names and need to extract the numbers look at ?strsplit or ?substring. This will be easier or harder depending how variable the names are. For

[R] Rsge: recursive parallelization

2010-04-09 Thread Peter Danenberg
In principle, I'd like to be able to do something like this: sge.parLapply(seq(10), function(x) parLapply(seq(x), function(x) x^2)) In practice, however, I have to resort to acrobatics like this: sge.options(sge.remove.files=FALSE) sge.options(sge.qsub.options='-cwd -V')

Re: [R] Read data in sequences

2010-04-09 Thread Dieter Menne
RockO wrote: I tried to find a solution in the search list, but I cannot find it. I would like to read a .txt file with, let say, three variables, with two of which have repeated values in a number a columns. The variables: Treat, x1, x2. The values: A 2.5 3.4 2.7 5.6 5.7 5.4 10.1 9.4

Re: [R] Data manipulation problem

2010-04-09 Thread Dieter Menne
Bert Gunter wrote: Yes. Don't do this. (what you probably really want to do is fit a model with age as a factor, which can be done statistically e.g. by logistic regression; or graphically using conditioning plots, e.g. via trellis graphics (the lattice package). This avoids the

Re: [R] Ranking correlation with R

2010-04-09 Thread Joshua Wiley
On Fri, Apr 9, 2010 at 8:58 AM, David Nemer davidne...@gmail.com wrote: Hello Joshua, Thanks for your help. The ranking list doesn't have numbers (it doesn't matter the name of the file), just the file name, and the ranking is assumed base on the position of the file name in the list (so the

[R] Bootcov for two stage bootstrap

2010-04-09 Thread tonitogomez
Dear users, I'm trying to implement the nonparametric two-stage bootstrap (Davison and Hinkley 1997, pag 100-102) in R. As far as I understood, 'bootcov' is the most appropriate method to implement NONPARAMETRIC bootstrap in R when you have clustered data (?). I read the 'bootcov' manual but I

Re: [R] Ranking correlation with R

2010-04-09 Thread David Winsemius
On Apr 9, 2010, at 12:14 PM, Joshua Wiley wrote: On Fri, Apr 9, 2010 at 8:58 AM, David Nemer davidne...@gmail.com wrote: Hello Joshua, Thanks for your help. The ranking list doesn't have numbers (it doesn't matter the name of the file), just the file name, and the ranking is assumed base

Re: [R] How to replace all non-maximum values in a row with 0

2010-04-09 Thread Dennis Murphy
Hi: This isn't much shorter than the previous solution, but here's another take, operating row-wise. A - matrix (c(2, 3, 0, 0, 200, 30, 0, 0, 2, 50, 0, 0, 3, 0, 0, 0, 0, 8, 8, 0), nrow = 4, byrow=T) # Write a vector function to apply to each row: begin by

[R] Read data in sequences

2010-04-09 Thread RockO
Dear R users, I tried to find a solution in the search list, but I cannot find it. I would like to read a .txt file with, let say, three variables, with two of which have repeated values in a number a columns. An example: The variables: Treat, x1, x2. The values: A 2.5 3.4 2.7 5.6 5.7 5.4

Re: [R] I can´t run the example shown in the inline pa ckage

2010-04-09 Thread satu
Dear Romain, you are right. Apologies, here is the complete result from your script: code - '#include Rdefines.h\nSEXP f(){\n return R_NilValue ; }' writeLines( code, test.c ) system( R CMD SHLIB test.c ) gcc -IC:/R/R-210~1.1/include-O3 -Wall -std=gnu99 -c test.c -o test.o gcc

[R] Trouble with mChoice() in the Hmisc package.

2010-04-09 Thread Jim Java
Hi All:-- I've started using the the Hmisc reporting facilities recently, mostly successfully. I'm having some trouble with mChoice() multiple-choice objects, though. Here's some example code and output from R-help a couple of years ago: library(Hmisc) Symptom1 - c(Headache, Headache, NA)

Re: [R] Ranking correlation with R

2010-04-09 Thread Joshua Wiley
cor() requires numeric data.  To use it in this case, you would need to come up with rankings based on the position for each file name, and use those pairs of numbers with cor(). One possible source for such numbers would be row.names(dfrm) since by default (assuming they are in a

Re: [R] fill in values between rollapply

2010-04-09 Thread Dennis Murphy
Hi: Not exactly elegant, but here's one approach: library(zoo) x - zoo( rpois(100, 40) ) w - rollapply(x, 5, mean, by = 5, align = c('left')) x2 - rep(w, each = 5) Does that work? HTH, Dennis On Fri, Apr 9, 2010 at 12:32 AM, Brad Patrick Schneid bpsch...@gmail.comwrote: Hi, Sorry ahead of

Re: [R] GARCH estimation with exogenous variables in the mean equation

2010-04-09 Thread Edwin Sun
Hello, I have the similar issue in estimating a GARCH model with exogenous variables in the mean equation. Currently, to my understanding, the garch function in tseries package can handle univariate model, and garchFit in fGarch can handle ARMA specification. I wonder if there is any R

Re: [R] Read data in sequences

2010-04-09 Thread Phil Spector
Rock - Here's one way: x = textConnection('A 2.5 3.4 2.7 5.6 5.7 5.4 10.1 9.4 + B 5.3 5.4 6.5 7.5 1.3 4.5 10.5 4.1') dat = read.table(x) names(dat) = c('grp','x1','x2','x3','x4','x5','x6','x7','x8') reshape(dat,idvar='grp',varying=list(c('x1','x3','x5','x7'), +

Re: [R] How to run Shapiro-Wilk test for each grouped variable?

2010-04-09 Thread David Winsemius
On Apr 9, 2010, at 10:51 AM, Iurie Malai wrote: Thank you, David! Here is the code to read my file: data - read.table(data.txt, header=TRUE, sep=;, na.strings=NA, dec=., strip.white=TRUE) Jorge Ivan Velez gave me a working solution, but I am ready to learn yours to. I don't think I

Re: [R] How to use tapply for quantile

2010-04-09 Thread Charles C. Berry
On Thu, 8 Apr 2010, James Rome wrote: I am trying to calculate quantiles of a data frame column split up by two factors: # Calculate the quantiles quarts = tapply(gdf$tt, list(gdf$Runway, gdf$OnHour), FUN=quantile, na.rm = TRUE) This does not work: It seems like it did work. It returned a

Re: [R] Ranking correlation with R

2010-04-09 Thread Joshua Wiley
On Fri, Apr 9, 2010 at 10:23 AM, David Nemer davidne...@gmail.com wrote: Would that also work if in one ranking I have a filename that it is not in the other ranking? match() will return an NA, if it cannot find a match, in which case you could use the argument: use=pairwise.complete.obs) in

[R] Question on implementing Random Forests scoring

2010-04-09 Thread Larry D'Agostino
So I've been working with Random Forests ( R library is randomForest) and I curious if Random Forests could be applied to classifying on a real time basis. For instance lets say I've scored fraud from a group of transactions. If I want to score any new incoming transactions for fraud could

[R] Excel R1C1 reference style in Rcom?

2010-04-09 Thread Albert-Jan Roskam
Hi, I have created the Boolean function below to evaluate if a given cell in an Excel file contains a formula. I have to process hundreds of excel files and I want to filter out any cells that contain formulae. Now I want to use the isXlsFormula function below when I loop through all the

Re: [R] Multiple comparisons for a two-factor ANCOVA

2010-04-09 Thread RICHARD M. HEIBERGER
On Wed, Apr 7, 2010 at 9:25 PM, Eric Scott ersco...@illinois.edu wrote: Thank you for your reply. The WoodEnergy example helped a lot. I understand now that it is inappropriate to make all pairwise comparisons with an interaction present and better to make comparisons between levels of one

[R] rjags syntax error

2010-04-09 Thread Christopher David Desjardins
Hi, I am getting the following error when I'm running jags.model() meas1 - jags.model(file=measurement.bug,data=dat.test) syntax error, unexpected '}', expecting ',' or ')' Error in jags.model(file = measurement.bug, data = dat.test) : Parse error on line 1 Below is my JAGS model. Please

[R] maSigPro

2010-04-09 Thread Luis Felipe Parra
Hello, I am using the maSigPro package to use the two.ways.stepback command, this command performs backward selection, I would like it to do it wtihout an intercept in the regression, do you know how can I do this, or how can I see the packages code or scripts in order to be able to modify it?

[R] step function

2010-04-09 Thread Luis Felipe Parra
Hello I am using the step function in order to do backward selection for a linear model of 52 variables with the following commands: object-lm(vars[,1] ~ (vars[,2:(ncol(predictors)+1)]-1)) BackS-step(object,direction=backward) but it isn't dropping any if the variables in the model, but there

Re: [R] 3-D response surface using wireframe()

2010-04-09 Thread array chip
Hi David and Felix, Thank you very much for your suggestions. To be honest, this has become beyond my understanding of lattice plots now. I am relatively new to lattice plots, so have no idea how function within function works (for example, how does panel.3dpolygon() within

[R] Brier's score for bootstrap sample (coxph)

2010-04-09 Thread paaventhan jeyaganth
Dear all, How can i get brier's score for the bootsrap sample for survival analysis. this are the code i am using for the validation. f1 - cph(Surv(time,dead ) ~ strata(x1)+strata(x2)+strata(x3), x=TRUE, y=TRUE, surv=TRUE, time.inc=12, data=new) validate(f1,B=200,u=12,dxy=T)

[R] Evaluate variable

2010-04-09 Thread Nic Rivers
Dear R-users: I would like to create a system of regression equations of length n, where the variables are drawn from a data frame. The result I would like is given by the variable named system in the code below. However, when I use a loop to create the system of equations, I cannot

Re: [R] Evaluate variable

2010-04-09 Thread Douglas Bates
You probably want to use substitute() to construct your formula and be careful of the distinction between character strings and names substitute(foo ~ bar, list(foo = as.name(y), bar = as.name(x))) y ~ x On Fri, Apr 9, 2010 at 2:06 PM, Nic Rivers njriv...@sfu.ca wrote: Dear R-users: I would

Re: [R] Question on implementing Random Forests scoring

2010-04-09 Thread Liaw, Andy
From: Larry D'Agostino So I've been working with Random Forests ( R library is randomForest) and I curious if Random Forests could be applied to classifying on a real time basis. For instance lets say I've scored fraud from a group of transactions. If I want to score any new incoming

Re: [R] Question on implementing Random Forests scoring

2010-04-09 Thread Larry D'Agostino
On Fri, Apr 9, 2010 at 2:15 PM, Liaw, Andy andy_l...@merck.com wrote: From: Larry D'Agostino So I've been working with Random Forests ( R library is randomForest) and I curious if Random Forests could be applied to classifying on a real time basis. For instance lets say I've scored

Re: [R] 3-D response surface using wireframe()

2010-04-09 Thread array chip
Sorry the example plot didn't go through last time, here it is: Thanks John --- On Fri, 4/9/10, array chip arrayprof...@yahoo.com wrote: From: array chip arrayprof...@yahoo.com Subject: Re: [R] 3-D response surface using wireframe() To: David Winsemius dwinsem...@comcast.net, Felix Andrews

Re: [R] Question on implementing Random Forests scoring

2010-04-09 Thread rmailbox
You may also wish to check out the PMML approach. Check out the PMML package. eRic - Original message - From: Liaw, Andy andy_l...@merck.com To: Larry D'Agostino ieorto...@gmail.com, r-help r-help@r-project.org Date: Fri, 9 Apr 2010 15:15:11 -0400 Subject: Re: [R] Question on

Re: [R] 3-D response surface using wireframe()

2010-04-09 Thread David Winsemius
I do not think the mail server accepts .jpg formats which was the format in which I got your attachment the first time (because of your having copied me directly.) I don't see much need to send a pdf because the code you offered does work and the data made it through (because .txt and

[R] Fox's algorithm?

2010-04-09 Thread Blair Christian
I'm interested in a serial implementation of fox's algorithm for memory management reasons. Does anybody know if there is anything available in R or C libraries? [eg A %*% B is too big to allocate memory for. I really want the values written to disk, so I was thinking that it would be easiest

Re: [R] Error Bars in lattice- barcharts

2010-04-09 Thread Sam Albers
Well, when the error message says argument 'lx' is missing, with no default, it really means that argument 'lx' is missing, with no default. Your panel function has an argument 'lx', which you forgot to change to 'ly' as you did with the prepanel function. Hope that helps... Thanks for

[R] perhaps regular expression bug with | sign ??

2010-04-09 Thread David.Epstein
Here is my interaction with R: sub(x='|t|',pattern = '|t',replacement='zz') [1] zz|t| So I say to myself Clearly the | signs need to be escaped, so let's try this sub(x='|t|',pattern = '\|t',replacement='zz') [1] zz|t| Warning messages: 1: '\|' is an unrecognized escape in a character string

Re: [R] perhaps regular expression bug with | sign ??

2010-04-09 Thread jim holtman
you need to escape it (twice): sub(x='|t|',pattern = '\\|t',replacement='zz') [1] zz| On Fri, Apr 9, 2010 at 4:35 PM, David.Epstein david.epst...@warwick.ac.ukwrote: Here is my interaction with R: sub(x='|t|',pattern = '|t',replacement='zz') [1] zz|t| So I say to myself Clearly the |

Re: [R] 3-D response surface using wireframe()

2010-04-09 Thread array chip
David, Thanks for the 2 previous posts from Sarkar. Actually, I am now one step closer. I am now able to remove the 3 outer lines of the bounding box using par.box argument, even Sarkar said in his 2008 post that par.box() does not control different boundaries, so maybe it was fixed.

Re: [R] perhaps regular expression bug with | sign ??

2010-04-09 Thread Henrique Dallazuanna
Try this: sub(x='|t|',pattern = '\\|t',replacement='zz') On Fri, Apr 9, 2010 at 5:35 PM, David.Epstein david.epst...@warwick.ac.uk wrote: Here is my interaction with R: sub(x='|t|',pattern = '|t',replacement='zz') [1] zz|t| So I say to myself Clearly the | signs need to be escaped, so

Re: [R] perhaps regular expression bug with | sign ??

2010-04-09 Thread Phil Spector
David - Here's the last paragraph of the Details section of the regex help page: Patterns are described here as they would be printed by ‘cat’: (_do remember that backslashes need to be doubled when entering R character strings_, e.g. from the keyboard). You can get around this

Re: [R] perhaps regular expression bug with | sign ??

2010-04-09 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David.Epstein Sent: Friday, April 09, 2010 1:36 PM To: r-help@r-project.org Subject: [R] perhaps regular expression bug with | sign ?? Here is my interaction with R:

[R] function rep

2010-04-09 Thread Covelli Paolo
Hi, I've got the following code: p - 0.34 pb - p*100 pr - (1-p)*100 A - rep(0,pb) # a vector with 34 zeros B - rep(1,pr) # a vector with 66 ones Now if I type length(A), R answer correctly 34 but if I type length(B), R answer 65 instead of 66. I don't understand why it happens. Can

Re: [R] function rep

2010-04-09 Thread Erik Iverson
Hello, Covelli Paolo wrote: Hi, I've got the following code: p - 0.34 pb - p*100 pr - (1-p)*100 A - rep(0,pb) # a vector with 34 zeros B - rep(1,pr) # a vector with 66 ones Not true. I counted them myself. There are only 65. I see pr == 66 [1] FALSE pr 66 [1] TRUE So pr must not

Re: [R] function rep

2010-04-09 Thread Gang Liang
pr is a numeric number indeed slightly less than 66, hence, the vector generated by rep(1,pr) is of length 65 rather than 66... On Fri, Apr 9, 2010 at 1:58 PM, Covelli Paolo pcove...@tele2.it wrote: Hi, I've got the following code: p - 0.34 pb - p*100 pr - (1-p)*100 A - rep(0,pb) # a

Re: [R] function rep

2010-04-09 Thread Henrique Dallazuanna
See FAQ 7.31 Why doesn't R think these numbers are equal? and try this: rep(1, ceiling(pr)) On Fri, Apr 9, 2010 at 5:58 PM, Covelli Paolo pcove...@tele2.it wrote: Hi, I've got the following code: p - 0.34 pb - p*100 pr - (1-p)*100 A - rep(0,pb)  # a vector with 34 zeros B - rep(1,pr)  

  1   2   >