[R] Find the 50 highest values in a matrix

2010-06-18 Thread uschlecht
Hi, I have a huge matrix (4000 * 2000 data points) and I would like to retrieve the coordinates (column and row) for the top 50 (or x) values. Some positions in the matrix have NA as a value. These should be discarded. My current method is to replace all NAs by 0, then rank all the values and

Re: [R] Drawing paths through a grid

2010-06-18 Thread Tal Galili
Hi Rex, It sounds like something that can be done with ?lines If you would supply with a simple self contained data that represents what you are trying to plot, then we might be able to better help you. If you have the data in R, use dput to be able to copy paste it into the email. Cheers, Tal

[R] 12th Root of a Square (Transition) Matrix

2010-06-18 Thread Corey Gallon
Dear R-tisans, I am trying to calculate the 12th root of a transition (square) matrix, but can't seem to obtain an accurate result. I realize that this post is laced with intimations of quantitative finance, but the question is both R-related and broadly mathematical. That said, I'm happy to

[R] Latex problem in Hmisc (3.8-1) and Mac Os X with R 2.11.1

2010-06-18 Thread moleps islon
Dear all, I did post this more or less identical mail in a follow up to another question I posted, but under another heading. I try again, but now under the correct header. upon running this code (from the Hmisc library-latex function) I believe the call to summary.formula is allright and

Re: [R] Read code from character string

2010-06-18 Thread Johannes Huesing
Peter Langfelder peter.langfel...@gmail.com [Thu, Jun 17, 2010 at 09:38:45PM CEST]: eval(parse(text=print(9**2))) cheers, I overlooked the text option. On Thu, Jun 17, 2010 at 12:32 PM, Johannes Huesing johan...@huesing.name wrote: Dear expRts, I have a character string, say a -

Re: [R] help for reshape function

2010-06-18 Thread Joshua Wiley
Hello, Try this, it is based off of your sample wide format data. I am not quite sure how you got the 'gene1' column in your desired output data, it looks like it is just the data from patient1, but since I was not sure, I did not include it. ## temp -

Re: [R] [ADMB Users] an alternative to R for nonlinear stat models

2010-06-18 Thread Rubén Roa
De: Chris Gast [mailto:cmg...@gmail.com] Enviado el: jueves, 17 de junio de 2010 22:32 Para: Rubén Roa CC: r-help@r-project.org; us...@admb-project.org Asunto: Re: [ADMB Users] an alternative to R for nonlinear stat models

Re: [R] No graphics capability on fresh install of R2.11.0 on FreeBSD 8.0

2010-06-18 Thread Rainer Hurling
On 17.06.2010 04:45 (UTC+1), Ben Madin wrote: G'day all, Hi Ben, I am working on a new FreeBSD 8.0 Server (remotely located), and have installed (now several times) R 2.11.0 but I cannot get any graphic outputs (everything else seems to be happening fine...) i'm also working with FreeBSD

Re: [R] Optimization problem

2010-06-18 Thread José E. Lozano
How about smoothing the percentages, and then take the second derrivative to find the inflection point? which.max(diff(diff((lowess(percentages)$y This solution is what I've been using so far. The only difference is that I am smoothing the 1st derivative, since its the one I want to be

Re: [R] Find the 50 highest values in a matrix

2010-06-18 Thread Nikhil Kaza
Matrix is just a vector. So order should work haven't verified the following code. a - matrix(rnorm(4000*2000), 4000, 2000) b - order(a, na.last=TRUE, decreasing=TRUE)[1:50] use %% or %/% to get the row# and column #s Nikhil Kaza Asst. Professor, City and Regional Planning University of

Re: [R] Optimization problem

2010-06-18 Thread José E. Lozano
Hello: Here is a general approach using smoothing using the Gasser-Mueller kernel, which is implemented in the lokern package. The optimal bandwidth for derivative estimation is automatically chosen using a plug-in approximation. The code and the results are attached here. Maybe am I

[R] double integral

2010-06-18 Thread suman dhara
Sir, I want to calculate double integral in R. Is there any function to do this? Regards, Suman Dhara [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] how to construct a TSdata with multivariate time serials

2010-06-18 Thread hujinfei
Dear all, Right now, I met with a question. Our datum is multivariate time series datum. The factors are combinations of four variables such as ( age, type, x_ coordinate and y_ coordinate). For each day, there are different combinations of factors, so corresponding to the factor

[R] ow to apply a panel function to each of several data series plotted on the same graph in lattice

2010-06-18 Thread David Wyllie
Hi is it possible to fit a trend line (or some other panel function) through each of multiple data series plotted on the same graph? Specifically, while one can do something like xyplot(a+b+c~x) which plots three series, a,b c, but can one automatically fit lines through each of them? I

Re: [R] Optimization problem

2010-06-18 Thread José E. Lozano
How about smoothing the percentages, and then take the second derrivative to find the inflection point? which.max(diff(diff((lowess(percentages)$y This solution is what I've been using so far. The only difference is that I am smoothing the 1st derivative, since its the one I want to

Re: [R] Optimization problem

2010-06-18 Thread William Simpson
I don't see why one would want to pretend that the function is continuous. It isn't. The x variable devices is discrete. Moreover, the whole solution space is small: the possible solutions are integers in the range of maybe 20-30. Bill On Fri, Jun 18, 2010 at 9:00 AM, José E. Lozano

Re: [R] Problems using allEffects() (package effect)

2010-06-18 Thread Jonas Mandel
Hello, Sorry for the lack of clarity, I thought I was clear about the package : it's the function allEffects from the package effects. Here is my example again (unfortunately I can't give the data) : The data concerns effects of 3 treatments on the tumoral volume of mice. head(data)

Re: [R] Optimization problem

2010-06-18 Thread José E. Lozano
I don't see why one would want to pretend that the function is continuous. It isn't. The x variable devices is discrete. Moreover, the whole solution space is small: the possible solutions are integers in the range of maybe 20-30. Yes, you are right, what I'd like to think is that the outcome

Re: [R] Problems using allEffects() (package effect)

2010-06-18 Thread Joris Meys
Could you then at least give the summary of the lm? It's really impossible to tell where your problem is without any information about the fit. It's a strange error, I never had it in this context, and this kind of errors often indicate that what goes in is wrong. Your lm() object is not well

[R] Extract estimates from each dataset: MI package

2010-06-18 Thread KDT
Dear All, I am currently using the MI package (Su, Gelman, Hill and Yajima) to make multiple Imputations of my dataset with missing values. After fitting a model, I can use display(model) to visualize the pooled estimates as well as estimates of each imputed dataset. I can visualize these also by

[R] Drawing sample from a circle

2010-06-18 Thread Ron Michael
Hi, I would like to draw 10 uniformly distributed sample points from a circle with redius one and centered at (0,0). Is there any R function to do that?   Thanks, [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Is there a non-parametric repeated-measures Anova in R ?

2010-06-18 Thread Maciej Hoffman-Wecker
/r-help/attachments/20100618/a8d2f366/attachment.pdf -- next part -- An embedded and charset-unspecified text was scrubbed... Name: MktRoll.R URL: https://stat.ethz.ch/pipermail/r-help/attachments/20100618/a8d2f366/attachment.pl

Re: [R] Problems using allEffects() (package effect)

2010-06-18 Thread Jonas Mandel
I have no error when fitting the model. The summary and anova seems to be fine : summary(lm1) Call: lm(formula = Volume ~ temps + Traitement:temps + Série, data = data) Residuals: Min 1Q Median 3Q Max -34.3134 -14.9527 -0.9835 12.9174 49.5546 Coefficients:

Re: [R] meta analysis with repeated measure-designs?

2010-06-18 Thread Mike Cheung
Dear Gerrit, Sorry. There was an error in my previous code. As a record, the followings are the revised code. Robust SE based on Hedges et al., (2010) Eq. 6 on Research Synthesis Methods rma.obj: object fitted by metafor() cluster: indicator for clusters of studies robustSE -

[R] New course schedule and new locations

2010-06-18 Thread Sarah Lewis
Hi all, Mango have released their updated training schedule which includes new courses and new locations. Hadley Wickham will also be coming to London to teach Data Visualisation in R. Please see details below: Public Courses Our public courses include introductory to advanced training in

Re: [R] Drawing sample from a circle

2010-06-18 Thread Ted Harding
On 18-Jun-10 08:04:36, Ron Michael wrote: Hi, I would like to draw 10 uniformly distributed sample points from a circle with redius one and centered at (0,0). Is there any R function to do that? _ Thanks, You can quite easily write one. [A] Sampling uniformly on the circumference of the

Re: [R] Problems using allEffects() (package effect)

2010-06-18 Thread Joris Meys
That's about the worst fit possible if you ask me :-) Check the fitted parameters, very likely indeed that there is your problem. You'll definitely have to reconsider your method. an lm is far from optimal on this dataset. Plus, you should use serie as a random or nesting factor. I'd suggest you

Re: [R] double integral

2010-06-18 Thread Joris Meys
http://www.google.com/#hl=ensource=hpq=double+integral+Raq=faqi=g5aql=oq=gs_rfai=fp=64f719c8669fe4b7 Sure you heard about google before? Cheers Joris On Fri, Jun 18, 2010 at 8:05 AM, suman dhara suman.dhar...@gmail.com wrote: Sir, I want to calculate double integral in R. Is there any function

Re: [R] double integral

2010-06-18 Thread Hans W Borchers
suman dhara suman.dhara89 at gmail.com writes: Sir, I want to calculate double integral in R. Is there any function to do this? If your domain of integration is a hypercube, try packages 'cubature' or 'R2cuba'. Otherwise, you have to uncover more information about your specific problem

[R] [OOPS] Re: Drawing sample from a circle

2010-06-18 Thread Ted Harding
OOPS: AN error on the code below! See in-line. Ted. On 18-Jun-10 09:33:04, Ted Harding wrote: On 18-Jun-10 08:04:36, Ron Michael wrote: Hi, I would like to draw 10 uniformly distributed sample points from a circle with redius one and centered at (0,0). Is there any R function to do that? _

Re: [R] Extract estimates from each dataset: MI package

2010-06-18 Thread Joris Meys
A good idea would be to read the posting guide : PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. No really, do read it. It's not there just to annoy people, it really has a function. Getting you to

Re: [R] 12th Root of a Square (Transition) Matrix

2010-06-18 Thread Duncan Murdoch
On 18/06/2010 2:01 AM, Corey Gallon wrote: Dear R-tisans, I am trying to calculate the 12th root of a transition (square) matrix, but can't seem to obtain an accurate result. I realize that this post is laced with intimations of quantitative finance, but the question is both R-related and

Re: [R] ask a question about data sets element

2010-06-18 Thread Dennis Murphy
Hi: Here's another approach: library(reshape) l - list(a1, a2, a3, a4) ll - melt(l) ll[ll$value %in% i, 'L1'] # [1] 1 3 HTH, Dennis On Thu, Jun 17, 2010 at 4:40 PM, song song rprojecth...@gmail.com wrote: for example, I have a1=c(1,3,5) a2=c(2,4,6) a3=c(7,8) a4=c(9,10) now if I have

Re: [R] Find the 50 highest values in a matrix

2010-06-18 Thread Dennis Murphy
Hi: Here's a faked up example: a - matrix(rnorm(4000*2000), 4000, 2000) # Generate some NAs in the matrix nr - sample(50, 1:4000) nc - sample(50, 1:2000) a[nr, nc] - NA # convert to data frame: b - data.frame(row = rep(1:4000, 2000), col = rep(1:2000, each = 4000), x =

Re: [R] ow to apply a panel function to each of several data series plotted on the same graph in lattice

2010-06-18 Thread Dennis Murphy
Hi: Here's a simple example: a - rnorm(100) b - rnorm(100, 2) c - rnorm(100, 5) x - 1:100 library(lattice) xyplot(a + b + c ~ x, type = 'l') HTH, Dennis On Fri, Jun 18, 2010 at 12:45 AM, David Wyllie david.wyl...@ndm.ox.ac.ukwrote: Hi is it possible to fit a trend line (or some other panel

Re: [R] Find the 50 highest values in a matrix

2010-06-18 Thread Peter Ehlers
m - matrix(round(rnorm(4000 * 2000), 4), nr = 4000) is.na(m) - sample(8e6, 1e6) system.time( idx - which( matrix(m %in% head(sort(m, TRUE), 50), nr = nrow(m)), arr.ind = TRUE)) # user system elapsed # 3.120.193.18 -Peter Ehlers On 2010-06-18 5:13, Dennis

[R] simulating binary random numbers using 'mvtnorm'

2010-06-18 Thread Subramanian Swaminathan
Hi R-users, I just started learning R. I have a project on lot quality assurance sampling (LQAS). In this project I have to develop LQAS plans to make decision on stopping / continuing a programme. The LQAS plans is based on cluster sampling: selection of k clusters (villages) of m children 

Re: [R] R licensing query

2010-06-18 Thread Liviu Andronic
Dear Gina On Thu, Jun 17, 2010 at 10:28 AM, McAllister, Gina gina.mcallis...@luht.scot.nhs.uk wrote: S-plus or any other stats programme.  Can anyone suggest anything or send me a suitable email? This issue pops up regularly on r-help, so there are many ideas available in the ML archives. One

Re: [R] Find the 50 highest values in a matrix

2010-06-18 Thread Henrik Bengtsson
You might also want to consider _partial sorting_ by using the 'partial' argument of sort(), especially when the number of data points is really large. Since argument 'decreasing=FALSE' is not supported when using 'partial', you have to flip it yourself by negating the values, e.g. x -

Re: [R] Reading data from xls..........please help

2010-06-18 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 16.06.2010 22:14:33: Thanks for your reply. Possibly I donot have perl. I am not sure although. How I can find whether I have it? If I dont have it then where can I download it from? Do you have Excel? If yes you can Open Excel Select data you

Re: [R] how to apply a panel function to each of several data series plotted on the same graph in lattice

2010-06-18 Thread David Wyllie
Hi Thanks, but maybe I'm not making myself clear enough here. I think I'm already doing what you suggest, below the line # plot with fits .. in the original mail. I have made a little progress. I wish to apply a panel function to each of a,b,and c. When plotting xyplot(a + b + c ~ x, type =

Re: [R] One graph for each row

2010-06-18 Thread Jim Lemon
On 06/17/2010 11:14 PM, Markus Kohler wrote: Hi all, I have the following data (from a performance test) URL;time;Nr. of Users url1;0.101;1 url10;0.048;1 url2;0.097;10 url2;0.066;10 url3;0.915;30 url3;0.847;30 I want to have one plot for each url (times for 1,10,30 user), contained in

Re: [R] Reading data from xls..........please help

2010-06-18 Thread Katya Mauff
Surely you could also save the excel spreadsheet with the relevant data as a text file, and then read it into R as normal? Select save as in Excel and then change save as type to Text (Tab delimited)(*.txt). Save it in the directory you are using in R, (or change the directory in R to where

Re: [R] Reading data from xls..........please help

2010-06-18 Thread Joris Meys
If you're on windows and you never installed perl, then you don't have it. Another easy way to find out is to type perl in the search window under the start menu. If there's no perl.exe on your computer, you don't have it. Take a look at : http://www.perl.org/ If you download Perl, it doesn't

Re: [R] help for reshape function

2010-06-18 Thread Andrie de Vries
Xin Wei I have sympathy with your difficulties in understanding the reshape() function. May I recommend using the melt() and cast() functions instead, available in the reshape package. You can find information, help and examples here: http://had.co.nz/reshape/ This simplifies the coding of

[R] How to add example data to R package

2010-06-18 Thread wenjun zheng
Dear R Users, I want to add an data in raw type to my package, so it can not be loading by data(), and if I put it in the 'data' subdirectory, it will be missed after the package built. How to put a raw data into a package? Any suggestions will be appreciated. -- Wenjun

[R] R to solve search problems

2010-06-18 Thread Ambikesh Jayal
Hi All, I am new to R and want to use R to solve search problems (like Travelling salesman problem, finding nearest neighbour, hill climbing). Is this possible in R? To start with I want as follows. Find five float numbers whose sum is is equal to their product which should be 8000. x + y + z

[R] Using R to solve search problems

2010-06-18 Thread Ambikesh Jayal
Hi All, I am new to R and want to use R to solve search problems (like Traveling salesman problem, finding nearest neighbor, hill climbing). Is this possible in R? To start with I want as follows. Find five float numbers whose sum is is equal to their product which should be 8000. x + y + z +

Re: [R] Extract estimates from each dataset: MI package

2010-06-18 Thread KDT
Thanks Joris and pardon me for over assuming. let me add more information. My data is very huge and it is nested with repeated measurements. This is a sample of the dataset. id sex lang sch age chapt item length Resp 1 10 8 27.02095 31 4 0 1

[R] ploting dots with quentiles

2010-06-18 Thread kexinz
http://r.789695.n4.nabble.com/file/n2260087/%E6%8D%95%E8%8E%B7.png I am going to plot my data set like this, with means and 25% 75% quentiles. I've tried boxplot, but the output is not what I want. Should I use other functions? Thanks -- View this message in context:

Re: [R] Reading data from xls..........please help

2010-06-18 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 18.06.2010 14:00:47: Surely you could also save the excel spreadsheet with the relevant data as a text file, and then read it into R as normal? Select save as in Excel and then change save as type to Text (Tab delimited)(*.txt). Save it in

Re: [R] Using R to solve search problems

2010-06-18 Thread Achim Zeileis
On Fri, 18 Jun 2010, Ambikesh Jayal wrote: Hi All, I am new to R and want to use R to solve search problems (like Traveling salesman problem, finding nearest neighbor, hill climbing). Is this possible in R? For the TSP there is a dedicated package of the same name on CRAN. For the other

Re: [R] Extract estimates from each dataset: MI package

2010-06-18 Thread Joris Meys
That's indeed the information I needed. I found the solution, and I'll explain you how I reached it as well. Once you find your way around objects, you can solve these problems yourself rather easily. So bear with me for a moment. If you don't know what S4 classes are, please do a search on

[R] Proportional Denton Method

2010-06-18 Thread Valentin Todorov
Hi, I wonder if there is some R code available, implementing the proportional Denton method. Best regards, Valentin [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] Find the 50 highest values in a matrix

2010-06-18 Thread Dennis Murphy
Hi: From what I can tell, Henrik efficiently finds the 50 largest values without the matrix indices and Peter efficiently finds the matrix indices without the corresponding values. Let's combine the two: x - rnorm(8e6) is.na(x) - sample(8e6, 1e6) n - 50 x1 - sort(x, decreasing=TRUE)[1:n] # Find

Re: [R] Latex problem in Hmisc (3.8-1) and Mac Os X with R 2.11.1

2010-06-18 Thread Frank E Harrell Jr
On 06/18/2010 12:32 AM, moleps islon wrote: Dear all, I did post this more or less identical mail in a follow up to another question I posted, but under another heading. I try again, but now under the correct header. upon running this code (from the Hmisc library-latex function) I believe the

[R] inverse function of melt

2010-06-18 Thread n.via...@libero.it
Dear list, I'm looking for an inverse function of melt(which is in package reshape).Namely, I had a data frame like this (Table1) YEAR VAR1 VAR2 VAR3 1995 7 3 45 1996 5 632 1997 6 10 15 I transformed my data by using

Re: [R] plotting radial dendrograms

2010-06-18 Thread Joris Meys
In which format do you get the dendrogram out of the C code? If it's possible to get it as a newick or nexus formatted tree, you can get it easily into R with read.tree() or read.nexus() in the ape package. newick2phylog() from the ade4 package can be helpful as well, as you get a phylog object

Re: [R] mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-18 Thread Joris Meys
I see this question is still open, so let me try to give you some answer. As far as I understood, the smoothing splines are not used as pure random effects, but as a combination of random and fixed effects. Very simplified, the first two basis functions (intercept and linear effect) are added as a

[R] Use of .Fortran

2010-06-18 Thread David Scott
I have no experience with incorporating Fortran code and am probably doing something pretty stupid. I want to use the following Fortran subroutine (not written by me) in the file SSFcoef.f subroutine SSFcoef(nmax,nu,A,nrowA,ncolA) implicit double precision(a-h,o-z) implicit

Re: [R] Fitting Gamma distribution

2010-06-18 Thread Joris Meys
You can use rgamma to get a gamma distribution for use in qqplot, eg : x -rchisq(100,2) y- fitdistr(x,gamma) qqplot(rgamma(100,y$estimate[1],y$estimate[2], x) Cheers Joris On Wed, Jun 16, 2010 at 9:40 AM, Marcosco01 marco.scortich...@bancamarche.it wrote: I'm looking for goodness of fit

Re: [R] ploting dots with quentiles

2010-06-18 Thread David Winsemius
On Jun 18, 2010, at 8:03 AM, kexinz wrote: http://r.789695.n4.nabble.com/file/n2260087/%E6%8D%95%E8%8E%B7.png I am going to plot my data set like this, with means and 25% 75% quentiles. I've tried boxplot, but the output is not what I want. Should I use other functions? Thanks

[R] C interface

2010-06-18 Thread michael meyer
Greetings, I am trying to call simple C-code from R. I am on Windows XP with RTools installed. The C-function is #include R.h #include Rinternals.h #include Rmath.h #include Rdefines.h // prevent name mangling extern C { SEXP __cdecl test(SEXP s){ SEXP result; PROTECT(result =

Re: [R] mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-18 Thread Carlo Fezzi
Hi Joris, thanks for your reply, sorry I was being sloppy regarding the random effect representation fo the smooth functions. I am using the identity link, but I am not sure if the anova command will work since the df are the same as in Loglik. For example, if you add the following code to my

[R] Read SPSS v 18 .sav file

2010-06-18 Thread Larry Hotchkiss
Hi, I repeatedly get an error when trying to read an SPSS v. 18 .sav file into R. require(foreign) Loading required package: foreign femaleSPSS.dat - read.spss(female-04-02-2010.sav) Warning message: In read.spss(female-04-02-2010.sav) : female-04-02-2010.sav: Unrecognized record type 7,

Re: [R] Read SPSS v 18 .sav file

2010-06-18 Thread David Winsemius
On Jun 18, 2010, at 10:26 AM, Larry Hotchkiss wrote: Hi, I repeatedly get an error when trying to read an SPSS v. 18 .sav file into R. No, you did not get an error message. require(foreign) Loading required package: foreign femaleSPSS.dat - read.spss(female-04-02-2010.sav) Warning

[R] Summing using a boolean index vector

2010-06-18 Thread Dan Stanger
Hello all: I have a dataframe f of weekdays and value, and a Boolean vector with Fridays set to true, and other days set to false, created by fridays-(diff(f$weekdays) -1). I would like to create a vector of sums, for each week. That is, start summing on the first false value in the vector,

[R] ggplot2 boxplot: horizontal, univariate

2010-06-18 Thread Jacob Wegelin
In ggplot2, I would like to make a boxplot that has the following properties: (1) Contrary to default, the meaningful axis should be the horizontal axis. Lattice does this, for instance, by library(lattice);bwplot(~mtcars$mpg) (2) It is *univariate*, i.e., of a single vector, say mtcars$mpg.

Re: [R] Read code from character string

2010-06-18 Thread Greg Snow
You should also look at fortune(106) and think about possible other solutions to your overall objective. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org

[R] extract date time from a text file

2010-06-18 Thread Sebastian Kruk
I a have a text file where every line is like that: 2007-12-03 13:50:17 Juan Perez (yy-mm-dd hh:mm:ss First Name Second Name) I would like to make a data frame with two column one for date and the other one for name. When I use read.delim it was transformed in a data frame with 4 colums. Bye,

Re: [R] Use of .Fortran

2010-06-18 Thread Duncan Murdoch
On 18/06/2010 9:59 AM, David Scott wrote: I have no experience with incorporating Fortran code and am probably doing something pretty stupid. I want to use the following Fortran subroutine (not written by me) in the file SSFcoef.f subroutine SSFcoef(nmax,nu,A,nrowA,ncolA)

Re: [R] mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-18 Thread Simon Wood
On Wednesday 16 June 2010 20:33, Carlo Fezzi wrote: Dear all, I am using the mgcv package by Simon Wood to estimate an additive mixed model in which I assume normal distribution for the residuals. I would like to test this model vs a standard parametric mixed model, such as the ones which

[R] conditional inference trees extracting terminal node probabilities

2010-06-18 Thread Steve_Friedman
The ctree function (package party) provides a method for running conditional inference trees. Plotting results of ctree returns a binary map of the tree and for each terminal node a barplot of the probabilities of the response categories. For example: iris.ct - ctree(Species ~ . , data =

Re: [R] questions on some operators in R

2010-06-18 Thread Greg Snow
Just to expand a little on David's reply. The vs. and | vs. || issue is really about where and how you plan to use things. and | work on vectors and are intended to be used to combine logical vectors into a new logical vector (that can be used for various things). and || are used for

Re: [R] ggplot2 boxplot: horizontal, univariate

2010-06-18 Thread baptiste auguie
Try this, qplot(factor(0), mpg, data=mtcars, geom=boxplot, xlab=)+ coord_flip() + scale_x_discrete(breaks=NA) HTH, baptiste On 18 June 2010 16:47, Jacob Wegelin jacobwege...@fastmail.fm wrote: In ggplot2, I would like to make a boxplot that has the following properties: (1) Contrary to

Re: [R] Read SPSS v 18 .sav file

2010-06-18 Thread David Winsemius
On Jun 18, 2010, at 10:44 AM, David Winsemius wrote: On Jun 18, 2010, at 10:26 AM, Larry Hotchkiss wrote: Hi, I repeatedly get an error when trying to read an SPSS v. 18 .sav file into R. No, you did not get an error message. require(foreign) Loading required package: foreign

[R] Summing using a boolean index vector (repost in plain text).

2010-06-18 Thread Dan Stanger
Hello all: I have a dataframe f of weekdays and value, and a Boolean vector with Fridays set to true, and other days set to false, created by fridays-(diff(f$weekdays) -1). I would like to create a vector of sums, for each week. That is, start summing on the first false value in the vector,

Re: [R] Cforest and Random Forest memory use

2010-06-18 Thread Bert Gunter
Rich is right, of course. One way to think about it is this (parphrased from the section on the Curse of Dimensionality from Hastie et al's Statistical Learning Book): suppose 10 uniformly distributed points on a line give what you consider to be adequate coverage of the line. Then in 40

Re: [R] C interface

2010-06-18 Thread Romain Francois
Hello, This is not the appropriate mailing list. Use R-devel for questions about C, etc ... One thing that might help you is the inline package. require( inline ) fx - cfunction( signature( s = numeric ), ' SEXP result; PROTECT(result = NEW_NUMERIC(1)); double*

Re: [R] C interface

2010-06-18 Thread Matt Shotwell
Michael, Your function 'test' doesn't utilize any C++ features. Is there another reason you are using a C++ compiler (g++)? If not, why not just use a C compiler? You can then get rid of the 'extern C{}' wrapper, the '__cdecl' declaration, and the MAKEFLAGS variable. Also, you may know that the

Re: [R] Is there a non-parametric repeated-measures Anova in R ?

2010-06-18 Thread David Winsemius
: application/pdf Size: 934195 bytes Desc: not available URL: https://stat.ethz.ch/pipermail/r-help/attachments/20100618/a8d2f366/attachment.pdf -- next part -- An embedded and charset-unspecified text was scrubbed... Name: MktRoll.R URL: https://stat.ethz.ch/pipermail/r-help

Re: [R] mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-18 Thread Joris Meys
Seems like Simon answered your question already, but indeed, I think it is correct. I raised the same question here at the department a while ago, not believing it could actually give the correct results. Yet, the underestimation of the degrees of freedom is counterbalanced by the addition of the

Re: [R] Summing using a boolean index vector (repost in plain text).

2010-06-18 Thread jim holtman
?cumsum ?ave But without data (follow the posting guide) specific solution can not be specified On Fri, Jun 18, 2010 at 11:39 AM, Dan Stanger dstan...@eatonvance.com wrote: Hello all: I have a dataframe f of weekdays and value, and a Boolean vector with Fridays set to true, and other days

Re: [R] mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-18 Thread Carlo Fezzi
Dear Simon, thanks a lot for your prompt reply. Unfortunately I am still confused about which is the correct way to test the two models... as you point out: why in my example the two models have the same degrees of freedom? Intuitively it seems to me the gamm model is more flexible since, as I

[R] pcse package - clarifying question about arguments groupN and groupT

2010-06-18 Thread Dimitri Liakhovitski
Just two clarifying questions about the package pcse. Argument groupN: It should be a factor that tells us to what subgroup each record belongs, right? Argument groupT should be a vector that contains the time identifier. Can it be just a factor (e.g., 1, 2, 3, etc.) - or does it have to be in

Re: [R] extract date time from a text file

2010-06-18 Thread jim holtman
You data has 4 fields (separated by blanks) and that is what you are reading. Just write some code to combine the fields: newDF - data.frame(time=as.POSIXct(paste(oldDF[[1]], oldDF[[2]]), name=paste(oldDF[[3]], oldDF[[4]])) On Fri, Jun 18, 2010 at 10:58 AM, Sebastian Kruk

Re: [R] extract date time from a text file

2010-06-18 Thread Joris Meys
As the footer says: PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. There's probably another way using readLines or so to do it in one try, but say you used : frame - read.delim(some_file.ext) then

Re: [R] Is there a non-parametric repeated-measures Anova in R ?

2010-06-18 Thread Tal Galili
bytes Desc: not available URL: https://stat.ethz.ch/pipermail/r-help/attachments/20100618/a8d2f366/attachment.pdf -- next part -- An embedded and charset-unspecified text was scrubbed... Name: MktRoll.R URL: https://stat.ethz.ch/pipermail/r-help/attachments

Re: [R] questions on some operators in R

2010-06-18 Thread li li
Thank you all for your kind reply! Hannah 2010/6/18 Greg Snow greg.s...@imail.org Just to expand a little on David's reply. The vs. and | vs. || issue is really about where and how you plan to use things. and | work on vectors and are intended to be used to combine

[R] question in R

2010-06-18 Thread li li
Dear all, I am trying to calculate certain critical values from bivariate normal distribution (please see the function below). m - 10 rho - 0.1 k - 2 alpha - 0.05 ## calculate critical constants cc_z - numeric(m) var - matrix(c(1,rho,rho,1), nrow=2, ncol=2, byrow=T) for (i in 1:m){ if (i =

Re: [R] Summing using a boolean index vector (repost in plain text).

2010-06-18 Thread Dan Stanger
Hello Jim, Thank you for getting back to me. Cumsum does exactly what I needed as the following example shows. [1] TRUE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE TRUE FALSE cumsum(x) [1] 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5

Re: [R] mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-18 Thread Joris Meys
Just realized something: You should take into account that the LR test is actually only valid for _nested_ models. Your models are not nested. Hence, you shouldn't use the anova function to compare them, and you shouldn't compare the df. In fact, if you're interested in the contribution of a term,

Re: [R] extract date time from a text file

2010-06-18 Thread Henrique Dallazuanna
Try this: Lines - 2007-12-03 13:50:17 Juan Perez read.csv2(textConnection(gsub((:\\d{2})\\s, \\1;, Lines)), header = FALSE) On Fri, Jun 18, 2010 at 11:58 AM, Sebastian Kruk residuo.so...@gmail.comwrote: I a have a text file where every line is like that: 2007-12-03 13:50:17 Juan Perez

Re: [R] Read SPSS v 18 .sav file

2010-06-18 Thread Larry Hotchkiss
Thanks. This is good to know. -- Larry Original message Date: Fri, 18 Jun 2010 11:36:40 -0400 From: David Winsemius dwinsem...@comcast.net Subject: Re: [R] Read SPSS v 18 .sav file To: David Winsemius dwinsem...@comcast.net Cc: Larry Hotchkiss lar...@udel.edu, r-help@r-project.org

Re: [R] extract date time from a text file

2010-06-18 Thread Gabor Grothendieck
On Fri, Jun 18, 2010 at 10:58 AM, Sebastian Kruk residuo.so...@gmail.com wrote: I a have a text file where every line is like that: 2007-12-03 13:50:17 Juan Perez (yy-mm-dd hh:mm:ss First Name Second Name) I would like to make a data frame with two column one for date and the other one for

Re: [R] extract date time from a text file

2010-06-18 Thread Sebastian Kruk
Thanks, yes, I would like to do it in one try. I a have a text file called archivo where every line is like that: 2007-12-03 13:50:17 Juan Perez (yy-mm-dd hh:mm:ss First Name Second Name) My code is it: datos - read.delim(archivo,header=FALSE,sep= ,dec=., col.names=c(date,time,fname,

[R] Error: cannot allocate vector of size 31.8 Mb

2010-06-18 Thread harsh yadav
Hi, I am getting the following error while trying to run an R script: Error: cannot allocate vector of size 31.8 Mb I tried setting up memory.limit(), vsize, etc. but could not make it run. My computer has following configurations:- OS: Windows 7 Processor: Intel Core 2 Duo RAM: 4GB Thanks

[R] C Interface

2010-06-18 Thread michael meyer
Thanks for all replies. I will post the question on R-develop also since eventually I would like to compile more substantial C and C++ code into shared libraries. Michael [[alternative HTML version deleted]] __ R-help@r-project.org mailing

[R] pcse package - is it OK to use it when my regression is weighted by each subgroup's mean

2010-06-18 Thread Dimitri Liakhovitski
Hello! Just would like to make sure I am not doing something wrong. I am running an OLS regression. I have several subgroups in the data set (locations) - and in each location I have weekly data for 2 years - on my DV and on all predictors. Looks like this: location week DV Predictor1

Re: [R] Cforest and Random Forest memory use

2010-06-18 Thread Max Kuhn
Rich's calculations are correct, but from a practical standpoint I think that using all the data for the model is overkill for a few reasons: - the calculations that you show implicitly assume that the predictor values can be reliably differentiated from each other. Unless they are deterministic

  1   2   >