Re: [R] the proper way to use panel functions in lattice package?
On Mon, 13 Feb 2006, Deepayan Sarkar wrote: On 2/10/06, simon chou [EMAIL PROTECTED] wrote: Hi, I was trying to stack a topographic map readed in from esri shapefile with a contour map and a vector map. However, the plotMap(maptools) and contourplot(lattice) do not seem to work well on top of each other. Here is part of my code. xrange-range(225000:35) yrange-range(2685000:281) basemap - read.shape(Twn25_town_dxf_Polygon.shp) plot.Map(basemap,xlim=xrange,ylim=yrange,fg=0,ol=8,xlab=,ylab=) contourplot(var1.pred~x+y, spcgrid, aspect = xy,label.style=align) I have tried to put panel function under plot.Map() but it gave some error message about some argoument matches other arguments. plot.Map (basemap,xlim=xrange,ylim=yrange,fg=0,ol=8,xlab=,ylab=,panel=function(x,y){ +contourplot(var1.pred~x+y, spcgrid, aspect = xy,label.style= align)}) Error in plot.default(xylims$x,xylims$y, asp=1,type=n,...): argument 9 matches multiple formal arguments I also tried to put plotMap() into contourplot()'s panel but plotMap cover up the conour. Maybe, there is something I miss in here. Yes, namely that `standard graphics' (the 'graphics' package) functions (like plotMap) don't (easily) work with grid graphics (the 'grid' package) which lattice uses. Unfortunately, I have no idea if there are any grid compatible equivalents of plotMap. In `standard graphics' this is not a problem, and can be built up by just by using the add=TRUE argument (using contour). You may find that, with many polygon boundaries and contours, you need to set line widths and/or colours to differentiate what is representing what. The lattice contourplot function also fills the inter-contour surfaces, so you would need to draw the polygon boundaries on top of the filled colour. As you can see from the example in the spatial graph gallery: http://r-spatial.sourceforge.net/gallery/#fig20.R this is far from easy, but with determination can be done (recall that lattice graphics are excellent for multiple plots conditioning on other variables, which is not the case here as far as you have explained). The example in the graph gallery is for kriged output, by the way. Using the maptools package and sp classes (see R-News), I would say: library(maptools) col - readShapePoly(system.file(shapes/columbus.shp, package=maptools)[1]) plot(col, border=grey) library(akima) # to make a grid crds - coordinates(col) contour(interp(crds[,1], crds[,2], col$CRIME), add=TRUE) or for an image: image(interp(crds[,1], crds[,2], col$CRIME), axes=FALSE) plot(col, border=grey35, add=TRUE) For these kinds of questions, the Task View (left panel on CRAN) called Spatial and the R-sig-geo mailing list might have helped. What went wrong there? Also, is there any diffeence between contourplot(lattice) and counterLine(base)? These 2 functions seem to give difference contour from the same data set. contourplot(lattice) seem to give better looking contour than contourLine() or contour(). contourplot uses contourLines (which I assume is what you meant) internally, so any differences probably stem from the choice of default arguments. ps. I krige 1700+ simulated observations into 4000+ regular spaced data to get contour. Deepayan __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] transforming data frame for use with persp
On Mon, 13 Feb 2006, Denis Chabot wrote: Hi, This is probably documented, but I cannot find the right words or expression for a search. My attempts failed. I have a data frame of 3 vectors (x, y and z) and would like to transform this so that I could use persp. Presently I have y-level copies of each x level, and a z value for each x-y pair. I need 2 columns giving the possible levels of x and y, and then a transformation of z from a long vector into a matrix of x-level rows and y-level columns. How do I accomplish this? Well, image() and friends have a rather strange representation, so it isn't obvious (see the help page: Notice that 'image' interprets the 'z' matrix as a table of 'f(x[i], y[j])' values, so that the x axis corresponds to row number and the y axis to column number, with column 1 at the bottom, i.e. a 90 degree counter-clockwise rotation of the conventional printed layout of a matrix.). So: Depth - seq(40,220, 20) Temp - seq(-1, 6, 0.5) My.data - expand.grid(Depth=Depth, Temp=Temp) predgam - -0.5*My.data$Depth + 12.5*My.data$Temp + 8*rnorm(nrow(My.data)) pred.data - data.frame(My.data, predgam) library(lattice) levelplot(predgam ~ Depth + Temp, pred.data) # for sanity check z - t(matrix(predgam, nrow=length(Temp), byrow=TRUE)) # see Notice image(Depth, Temp, z) persp(Depth, Temp, z) should do it, since the data are already in a regular grid. In this example, I made a set of x and y values to get predictions from a GAM, then combined them with the predictions into a data frame. This is the one I'd like to transform as described above: My.data - expand.grid(Depth=seq(40,220, 20), Temp=seq(-1, 6, 0.5)) predgam - predict.gam(dxt.gam, My.data, type=response) pred.data - data.frame(My.data, predgam) pred.data has 150 lines and 3 columns. Thanks for your help, Denis Chabot __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] combine elements of a character vector into a character
Hi R users I have a simple question to ask x - c(a,b,c) x [1] a b c I like to have abc instead of having a b c I tried to use paste and other functions related to character. Is there any function (command) that enable me to combine elements of a character vector into one character ? Thanks __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Fitdistr and MLE for parameter lambda of Poisson distribution
At 09:35 AM 2/10/2006, Gregor Gorjanc wrote: Hello! I would like to get MLE for parameter lambda of Poisson distribution. I can use fitdistr() for this. After looking a bit into the code of this function I can see that value for lambda and its standard error is estimated via estimate - mean(x) sds - sqrt(estimate/n) Is this MLE? With my poor math/stat knowledge I thought that MLE for Poisson parameter is (in mixture of LaTeX code) l(\lambda|x) \propto \sum^n_{i=1}(-\lambda + x_iln(\lambda)). Is this really equal to (\sum^n_{i=1} x_i) / n -- Lep pozdrav / With regards, Gregor Gorjanc Gregor, If I understood your LaTeX You is rigth. If you don´t know have a command wich make this for you: fitdistr() Look: d- rpois(50,5) d [1] 6 4 6 4 5 5 4 11 7 5 7 3 5 10 4 9 4 2 4 5 4 4 9 3 10 [26] 4 3 9 6 7 5 4 2 7 3 6 7 8 6 6 3 3 3 2 5 4 3 8 5 7 library(MASS) fitdistr(d,Poisson) lambda 5.320 (0.3261901) []s Tura __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] A concrete type I/III Sum of square problem
Hi R-help members, I have read a lot in the Archive about the Type I vs Type III sum of square. I think I have read confusing post so I want to have a clear idea of the problem. Here is an example. I have 3 groups of subjects of unequal sample size (G1 (n=7), G2 (n=7), G3 (n=4)). for Each subject I have 4 measures corresponding to the crossing of 2 factor (A B) of two levels each. my dependant variable is X. After reading a lot of tutorials on R I have tried the summary(aov(X~GROUP*A*B+Error(SUJECT/(A*B) ) This results are with type I SS. What's wrong with these results ? Should I use type III SS and, if so how to enter my design in Anova (car package, I still have not the J. Fox's book) ? I have clearly not understood the difference between type I III (with the limits of each approach). A link to a good tutorial on this topic will help me a lot. Sylvain CLEMENT Neuropsychology Auditory Cognition Team Lille, FRANCE __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] combine elements of a character vector into a character
probably you missed the 'collapse' argument of paste(); try this: paste(x, collapse = ) Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://www.med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: Taka Matzmoto [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Tuesday, February 14, 2006 9:32 AM Subject: [R] combine elements of a character vector into a character Hi R users I have a simple question to ask x - c(a,b,c) x [1] a b c I like to have abc instead of having a b c I tried to use paste and other functions related to character. Is there any function (command) that enable me to combine elements of a character vector into one character ? Thanks __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] combine elements of a character vector into a character
Taka Matzmoto wrote: Hi R users I have a simple question to ask x - c(a,b,c) x [1] a b c Try paste(x, collapse = ) DW I like to have abc instead of having a b c I tried to use paste and other functions related to character. Is there any function (command) that enable me to combine elements of a character vector into one character ? Thanks __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Fitdistr and MLE for parameter lambda of Poisson distribution
Bernardo Rangel tura wrote: At 09:35 AM 2/10/2006, Gregor Gorjanc wrote: Hello! I would like to get MLE for parameter lambda of Poisson distribution. I can use fitdistr() for this. After looking a bit into the code of this function I can see that value for lambda and its standard error is estimated via estimate - mean(x) sds - sqrt(estimate/n) Is this MLE? With my poor math/stat knowledge I thought that MLE for Poisson parameter is (in mixture of LaTeX code) l(\lambda|x) \propto \sum^n_{i=1}(-\lambda + x_iln(\lambda)). Is this really equal to (\sum^n_{i=1} x_i) / n -- Lep pozdrav / With regards, Gregor Gorjanc Gregor, If I understood your LaTeX You is rigth. If you don´t know have a command wich make this for you: fitdistr() Look: d- rpois(50,5) d [1] 6 4 6 4 5 5 4 11 7 5 7 3 5 10 4 9 4 2 4 5 4 4 9 3 10 [26] 4 3 9 6 7 5 4 2 7 3 6 7 8 6 6 3 3 3 2 5 4 3 8 5 7 library(MASS) fitdistr(d,Poisson) lambda 5.320 (0.3261901) Thanks for this, but I have already said in the first mail, that fitdistr can help me with this. I was just surprised or knowledge undernourished, that there is closed form solution for this. Look into the source of fitdistr. -- Lep pozdrav / With regards, Gregor Gorjanc -- University of Ljubljana PhD student Biotechnical Faculty Zootechnical Department URI: http://www.bfro.uni-lj.si/MR/ggorjan Groblje 3 mail: gregor.gorjanc at bfro.uni-lj.si SI-1230 Domzale tel: +386 (0)1 72 17 861 Slovenia, Europefax: +386 (0)1 72 17 888 -- One must learn by doing the thing; for though you think you know it, you have no certainty until you try. Sophocles ~ 450 B.C. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] indexing via a character matrix?
On Mon, 13 Feb 2006, Roger Levy wrote: Prof Brian Ripley wrote: On Mon, 13 Feb 2006, Roger Levy wrote: Hi, Is it possible to index via a character matrix? For example, I would like to do the following: cont.table - table(df1$A,df1$B) # df1 a data frame with factors A and B cont.table[cbind(df2$A,df2$B)] # df2 a smaller data frame with some # pairings of values for A and B but the second step does not work -- I guess that matrices to be used for indexing this way must be numeric. Is there a way to index multiple Numeric or logical. character tuples out of a contingency table without resorting to writing loops? What are you trying to do here? One possibility is that you meant comt.table[df2$A, df2$B] and another is ind1 - match(df2$A, df1$A) ind2 - match(df2$B, df1$B) cont.table[cbind(ind1, ind2)] and I am not certain which. Hmm, I think neither one is what I wanted. After thinking more about it, I think what I would need is ind1 - match(df2$A,levels(df1$A)) ind2 - match(df2$B,levels(df2$B)) cont.table[cbind(ind1,ind2)] Does this make sense? Is there a more natural way to express this? Not really. You said character, but you seem to have a factor (by the use of levels). It is the case that cont.table will have dims indexed by the levels of df1$A and df1$B, so perhaps you want ind1 - match(df2$A,levels(df1$A)) ind2 - match(df2$B,levels(df1$B)) cont.table[cbind(ind1,ind2)] That gives you a vector along rows of df2 giving the count of that A,B combination in df1 (provide all such occur). If some might not occur, use matchdf2$A,levels(df1$A), NA) etc. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] about list
Hello sir: A question about the usage of list: The data of a list: [[1]] genename comp diff lwr uprp.adj g2-g1 NewU1-R g2-g1 -242.6667 -337.9602 -147.3732 1.754308e-04 g3-g1 NewU1-R g3-g1 -266.6667 -361.9602 -171.3732 8.869357e-05 g4-g1 NewU1-R g4-g1 440.6667 345.3732 535.9602 2.055929e-06 [[2]] genename comp diff lwruprp.adj g2-g1 NewU1-R g2-g1 -242.6667 -337.9602 -147.37315 1.754308e-04 g3-g2 NewU1-R g3-g2 -24. -119.2935 71.29352 8.497181e-01 g4-g2 NewU1-R g4-g2 683. 588.0398 778.62685 4.785440e-08 [[3]] genename comp diff lwruprp.adj g3-g1 NewU2-R g3-g1 -266.6667 -361.9602 -171.37315 8.869357e-05 g3-g2 NewU2-R g3-g2 -24. -119.2935 71.29352 8.497181e-01 g4-g3 NewU2-R g4-g3 707. 612.0398 802.62685 3.713499e-08 [[4]] genename comp diff lwr uprp.adj g4-g1 NewU2-R g4-g1 440.6667 345.3732 535.9602 2.055929e-06 g4-g2 NewU2-R g4-g2 683. 588.0398 778.6268 4.785440e-08 g4-g3 NewU2-R g4-g3 707. 612.0398 802.6268 3.713499e-08 Actually, [[1]] and [[2]] are from the same group, [[3]] and [[4]] are from the same group. And how can I arrange [[1]] [[2]] together(the same as [[3]] and [[4]])? In other words,the result I want is: group1 genename comp diff lwr uprp.adj g2-g1 NewU1-R g2-g1 -242.6667 -337.9602 -147.3732 1.754308e-04 g3-g1 NewU1-R g3-g1 -266.6667 -361.9602 -171.3732 8.869357e-05 g4-g1 NewU1-R g4-g1 440.6667 345.3732 535.9602 2.055929e-06 group1 genename comp diff lwruprp.adj g2-g1 NewU1-R g2-g1 -242.6667 -337.9602 -147.37315 1.754308e-04 g3-g2 NewU1-R g3-g2 -24. -119.2935 71.29352 8.497181e-01 g4-g2 NewU1-R g4-g2 683. 588.0398 778.62685 4.785440e-08 group2 genename comp diff lwruprp.adj g3-g1 NewU2-R g3-g1 -266.6667 -361.9602 -171.37315 8.869357e-05 g3-g2 NewU2-R g3-g2 -24. -119.2935 71.29352 8.497181e-01 g4-g3 NewU2-R g4-g3 707. 612.0398 802.62685 3.713499e-08 group2 genename comp diff lwr uprp.adj g4-g1 NewU2-R g4-g1 440.6667 345.3732 535.9602 2.055929e-06 g4-g2 NewU2-R g4-g2 683. 588.0398 778.6268 4.785440e-08 g4-g3 NewU2-R g4-g3 707. 612.0398 802.6268 3.713499e-08 Thanks! My best __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] how I can perform Multivariate Garch analysis in R
It is too late now, but this would have been better asked on the R-sig-finance list. On 2005-09-22 there was an answer to a question on R-help MGARCH estimation that gave the address of a package for BEKK estimation. There is a working paper on the Burns Statistics website that explains how to do multivariate GARCH estimation when you only have software for univariate estimation. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and A Guide for the Unwilling S User) Arun Kumar Saha wrote: Dear aDVISOR, Hope I am not disturbing you. Can you tell me how I can perform Multivariate Garch analysis in R. Also please, it is my humble request let me know some resource materials on Multivariate Garch analysis itself. Sincerely yours, -- Arun Kumar Saha, M.Sc.[C.U.] S T A T I S T I C I A N[Analyst] Transgraph Consulting [www.transgraph.com] Hyderabad, INDIA Contact # Home: +91-033-25558038 Office: +91-040-55755003 Mobile: 919849957010 E-Mail: [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] about list
XinMeng wrote: Hello sir: A question about the usage of list: The data of a list: [[1]] genename comp diff lwr uprp.adj g2-g1 NewU1-R g2-g1 -242.6667 -337.9602 -147.3732 1.754308e-04 g3-g1 NewU1-R g3-g1 -266.6667 -361.9602 -171.3732 8.869357e-05 g4-g1 NewU1-R g4-g1 440.6667 345.3732 535.9602 2.055929e-06 [[2]] genename comp diff lwruprp.adj g2-g1 NewU1-R g2-g1 -242.6667 -337.9602 -147.37315 1.754308e-04 g3-g2 NewU1-R g3-g2 -24. -119.2935 71.29352 8.497181e-01 g4-g2 NewU1-R g4-g2 683. 588.0398 778.62685 4.785440e-08 [[3]] genename comp diff lwruprp.adj g3-g1 NewU2-R g3-g1 -266.6667 -361.9602 -171.37315 8.869357e-05 g3-g2 NewU2-R g3-g2 -24. -119.2935 71.29352 8.497181e-01 g4-g3 NewU2-R g4-g3 707. 612.0398 802.62685 3.713499e-08 [[4]] genename comp diff lwr uprp.adj g4-g1 NewU2-R g4-g1 440.6667 345.3732 535.9602 2.055929e-06 g4-g2 NewU2-R g4-g2 683. 588.0398 778.6268 4.785440e-08 g4-g3 NewU2-R g4-g3 707. 612.0398 802.6268 3.713499e-08 Actually, [[1]] and [[2]] are from the same group, [[3]] and [[4]] are from the same group. And how can I arrange [[1]] [[2]] together(the same as [[3]] and [[4]])? In other words,the result I want is: For example for a List L: list(L[1:2], L[3:4]) Uwe Ligges group1 genename comp diff lwr uprp.adj g2-g1 NewU1-R g2-g1 -242.6667 -337.9602 -147.3732 1.754308e-04 g3-g1 NewU1-R g3-g1 -266.6667 -361.9602 -171.3732 8.869357e-05 g4-g1 NewU1-R g4-g1 440.6667 345.3732 535.9602 2.055929e-06 group1 genename comp diff lwruprp.adj g2-g1 NewU1-R g2-g1 -242.6667 -337.9602 -147.37315 1.754308e-04 g3-g2 NewU1-R g3-g2 -24. -119.2935 71.29352 8.497181e-01 g4-g2 NewU1-R g4-g2 683. 588.0398 778.62685 4.785440e-08 group2 genename comp diff lwruprp.adj g3-g1 NewU2-R g3-g1 -266.6667 -361.9602 -171.37315 8.869357e-05 g3-g2 NewU2-R g3-g2 -24. -119.2935 71.29352 8.497181e-01 g4-g3 NewU2-R g4-g3 707. 612.0398 802.62685 3.713499e-08 group2 genename comp diff lwr uprp.adj g4-g1 NewU2-R g4-g1 440.6667 345.3732 535.9602 2.055929e-06 g4-g2 NewU2-R g4-g2 683. 588.0398 778.6268 4.785440e-08 g4-g3 NewU2-R g4-g3 707. 612.0398 802.6268 3.713499e-08 Thanks! My best __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Trying to save a *.jpg file from a PHP system call
Court Arning wrote: This is my first time making a request so please feel free to school me on how to improve on how to make an inquiry. I am running R-1.9.1 in UNIX via a PHP script with a system command to generate a *.jpg image from a list created by a perl script. This R script runs fine when run from a Unix command line or through a system command from Perl. In my debug efforts I had PHP print out the last executed command from R. The R script hangs on my jpeg(), touch(), and X11() commands in the script. If I comment these out the rest of the script will run through. I am running R under my html directory and I have ensured all permissions are fully open. I also set Sys.putenv() to the machine I am working on. Your constructive response will be appreciated. I guess you cannot open an X11 device ... Uwe Ligges Thanks __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Extracting Data form Simpleboot Output
Terry W. Schulz wrote: Hello, I am new to R, so forgive my ignorance on what is probably simple. I find package simpleboot quite useful for LOESS bootstrapping and generation of plots. I want to calculate the standard error for x=60 of the 100 grid points and 50 bootstraps. The code below gives the first fitted value. How can I grab the other 49 values easily? I could do it one at a time for 50 bootstraps, but this becomes tedious for say 2000 bootstraps. Thanks for any help. library(simpleboot) library(bootstrap) attach(cholost) set.seed(13579) lo - loess(y ~ z, data=cholost, span=.5, degree=2, family=gaussian, method=loess) lo.b - loess.boot(lo, R=50, rows = TRUE, new.xpts = NULL, ngrid = 100, weights = NULL) lo.b$boot.list$1$fitted[60] sapply(lo.b$boot.list, function(x) x$fitted) gives you the corresponding 100x50 matrix ... Uwe Ligges __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] AID / Tree Analysis in R
Dear Colleagues, I've been looking for a function that can perform a tree analysis, similar to CHAID or QUEST. The key point is that in this case the variables are not binary but nominal (10 different values), so tree (from the tree package) won't work. Does anybody know help? Sincerely, ___ Markus Preisetanz Consultant Client Vela GmbH Albert-Roßhaupter-Str. 32 81369 München fon: +49 (0) 89 742 17-113 fax: +49 (0) 89 742 17-150 mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged infor...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Parallel computing in R for dummies--how to optimize an external model?
Hi Scott, It is difficult to debug your issue without more information. Would it be possible to email me code of a simple example? Cheers, Jas. === Jasjeet S. Sekhon Associate Professor Travers Department of Political Science Survey Research Center UC Berkeley http://sekhon.polisci.berkeley.edu/ V: 510-642-9974 F: 617-507-5524 === Waichler, Scott R writes: I am trying to use the optimizing function genoud() with the snow package on a couple of i686 machines running Redhat Linux WS4 . I don't know anything about PVM or MPI, so I just followed the directions in snow and rgenoud for the simplest method and started a socket cluster. My function fn for genoud involves updating an input file for a separate numerical model with the latest parameter set from the optimizer, running the (compiled) model on the input file with system(), and processing the output including calculation of objective function. The whole process works on the localhost machine in one cpu, and I can see that an R session is created in the second, non-localhost machine, but it doesn't seem to be doing anything. All of the model runs generated by the application of genoud take place in the cpu. What am I missing? I can see where there would be a conflict in having multiple processors trying to access the same system model input file at once, but I don't see any indication of that type of problem. Grateful for any help, Scott Waichler Pacific Northwest National Laboratory [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] AID / Tree Analysis in R
On Tue, 14 Feb 2006, Markus Preisetanz wrote: I've been looking for a function that can perform a tree analysis, similar to CHAID or QUEST. The key point is that in this case the variables are not binary but nominal (10 different values), so tree (from the tree package) won't work. Does anybody know help? What makes you say that? It comes with examples of categorical variables. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] A concrete type I/III Sum of square problem
More to the point, you are confusing multistratum AOV with single-stratuam AOV. For a good tutorial, see MASS4 (bibliographic information in the R FAQ). For unbalanced data we suggest you use lme() instead. On Tue, 14 Feb 2006, WPhantom wrote: Hi R-help members, I have read a lot in the Archive about the Type I vs Type III sum of square. I think I have read confusing post so I want to have a clear idea of the problem. Here is an example. I have 3 groups of subjects of unequal sample size (G1 (n=7), G2 (n=7), G3 (n=4)). for Each subject I have 4 measures corresponding to the crossing of 2 factor (A B) of two levels each. my dependant variable is X. After reading a lot of tutorials on R I have tried the summary(aov(X~GROUP*A*B+Error(SUJECT/(A*B) ) This results are with type I SS. What's wrong with these results ? Should I use type III SS and, if so how to enter my design in Anova (car package, I still have not the J. Fox's book) ? I have clearly not understood the difference between type I III (with the limits of each approach). A link to a good tutorial on this topic will help me a lot. Sylvain CLEMENT Neuropsychology Auditory Cognition Team Lille, FRANCE -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] question about plotting survfit object on log-log scale
Dear all, I tried to plot cumulative hazard H(t) against t on a log-log sclale by putting the optional function fun ='cloglog' in the plot function. However, I came across the following error message survcs20fit2-survfit(Surv(start,end,status)~sx,data=ALLDPcs20) plot(survcs20fit2,fun=cloglog) Error in rep.default (2, n2 - 1) : invalid number of copies in rep ( ) In addition : Warning message: 2 x values = 0 omitted from logarithmic plot in : xy.coords ( x, y, xlabel, ylabel, log) What does the error message : Error in rep.default (2, n2 - 1) : invalid number of copies in rep ( ) actually means and what can I do to rectify it. Thanks for any help given! kind regards, sing yee [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Periodic B-spline surface
There's a periodic cubic spline smoother built into package mgcv's gam function (although it happens not to use a B-spline basis). This can be used in tensor product smooth surfaces. e.g. gam(y~te(x,z,bs=c(cc,cc))) best, Simon Hi.., is there any funcrion in R to fit a periodic B-spline Surface Harsh - Brings words and photos together (easily) with [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] AID / Tree Analysis in R
On Tue, 14 Feb 2006, Markus Preisetanz wrote: Dear Colleagues, I've been looking for a function that can perform a tree analysis, similar to CHAID or QUEST. `ctree' in package `party' implements unbiased recursive partitioning in a way inspired by CHAID. The methodological details are in @article{party2006, key = {566}, author = {Torsten Hothorn and Kurt Hornik and Achim Zeileis}, title = {Unbiased Recursive Partitioning: A Conditional Inference Framework}, journal = {Journal of Computational and Graphical Statistics}, year = 2006, note = {in press} } A preprint is available from http://statmath.wu-wien.ac.at/~zeileis/papers/Hothorn+Hornik+Zeileis-2006.pdf The package vignette explains the operational details. HTH, Torsten The key point is that in this case the variables are not binary but nominal (10 different values), so tree (from the tree package) won't work. Does anybody know help? Sincerely, ___ Markus Preisetanz Consultant Client Vela GmbH Albert-Roßhaupter-Str. 32 81369 München fon: +49 (0) 89 742 17-113 fax: +49 (0) 89 742 17-150 mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged infor...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R and Power Point
Hello Erin, Have you tried changing the font to a large, bold face font in the GUI preferences? This may take care of the resolution issues without needing to use power point, and give you the flexibility of a live R session. Best, Randy On 2/14/06 1:46 AM, Erin Hodgess [EMAIL PROTECTED] wrote: Dear R People: I'm using R in a time series class. This class is being broadcast live to 2 remote sites via closed circuit TV. My people at the remote sites are having a terrible time seeing the computer screen as it is broadcast(resolution issues). I have decided to put together Power Point slides for the teaching. I am currently saving the R screen as WMF files and inserting them into PowerPoint. While this works, it seems that there might be a simpler method. Does anyone have any suggestions for the Power Point, please? Thanks so much! R Version 2.2.1 Windows Sincerely, Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html ~~ Randall C Johnson Bioinformatics Analyst SAIC-Frederick, Inc (Contractor) Laboratory of Genomic Diversity NCI-Frederick, P.O. Box B Bldg 560, Rm 11-85 Frederick, MD 21702 Phone: (301) 846-1304 Fax: (301) 846-1686 ~~ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] read.table
Diethelm Wuertz wrote: Thanks a lot that works fine! Next problem, if I would have my own package, and the file test.csv would be located in the data directory How to use the function data to get data(test) Also put in the data subdirectory the file test.R with the commands to read test.csv Kjetil resulting in: test %y-%m-%d VALUE 1 1999-01-01 100 2 2000-12-31 999 Again Thanks in advance Diethelm Wuertz Phil Spector wrote: Look at the check.names= argument to read.table -- you want to set it to FALSE. But rememeber that you'l have to put quotes around the name whenever you use it, as in x$'%y-%m-%d' - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley [EMAIL PROTECTED] On Tue, 14 Feb 2006, Diethelm Wuertz wrote: I have a file named test.csv with the following 3 lines: %y-%m-%d;VALUE 1999-01-01;100 2000-12-31;999 read.table(test.csv, header = TRUE, sep = ;) delivers: X.y..m..d VALUE 1 1999-01-01 100 2 2000-12-31 999 I would like to see the following ... %y-%m-%d VALUE 1 1999-01-01 100 2 2000-12-31 999 Note, readLines(test.csv, 1) delivers [1] %y-%m-%d;VALUE Is this possible ??? Thanks DW __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] reshaping data
Thank you Berton, I will look into that method. Roger Berton Gunter [EMAIL PROTECTED] writes: ?unlist -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] how I can perform Multivariate Garch analysis in R
Arun Kumar Saha wrote: Dear aDVISOR, Hope I am not disturbing you. Can you tell me how I can perform Multivariate Garch analysis in R. Also please, it is my humble request let me know some resource materials on Multivariate Garch analysis itself. You could tryhelp.search(garch) or RSiteSearch(garch) But for me this only leads to univariate garch (at least two implementations). Kjetil Sincerely yours, -- Arun Kumar Saha, M.Sc.[C.U.] S T A T I S T I C I A N[Analyst] Transgraph Consulting [www.transgraph.com] Hyderabad, INDIA Contact # Home: +91-033-25558038 Office: +91-040-55755003 Mobile: 919849957010 E-Mail: [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] post-hoc comparisons following glmm
Dear Mr Graves, this seems work on my data. Thank you very much for your help. Sincerely Michael Coeurdassier Spencer Graves a écrit : The following appears to be an answer to your question, though I'd be pleased to receive critiques from others. Since your example is NOT self contained, I modified an example in the glmmPQL help file: (fit - glmmPQL(y ~ factor(week)-1+trt, random = ~ 1 | ID, + family = binomial, data = bacteria)) iteration 1 iteration 2 iteration 3 iteration 4 iteration 5 iteration 6 Linear mixed-effects model fit by maximum likelihood Data: bacteria Log-likelihood: -551.1184 Fixed: y ~ factor(week) - 1 + trt factor(week)0 factor(week)2 factor(week)4 factor(week)6 factor(week)11 3.3459650 3.5262521 1.9102037 1.7645881 1.7660845 trtdrug trtdrug+ -1.2527642 -0.7570441 Random effects: Formula: ~1 | ID (Intercept) Residual StdDev:1.426534 0.7747477 Variance function: Structure: fixed weights Formula: ~invwt Number of Observations: 220 Number of Groups: 50 anova(fit) numDF denDF F-value p-value factor(week) 5 166 10.821682 .0001 trt 248 1.889473 0.1622 (denDF.week - anova(fit)$denDF[1]) [1] 166 (denDF.week - anova(fit)$denDF[1]) [1] 166 (par.week - fixef(fit)[1:5]) factor(week)0 factor(week)2 factor(week)4 factor(week)6 factor(week)11 3.345965 3.526252 1.910204 1.764588 1.766085 (vc.week - vcov(fit)[1:5, 1:5]) factor(week)0 factor(week)2 factor(week)4 factor(week)6 factor(week)0 0.3351649 0.1799365 0.1705898 0.1694884 factor(week)2 0.1799365 0.3709887 0.1683038 0.1684096 factor(week)4 0.1705898 0.1683038 0.2655072 0.1655673 factor(week)6 0.1694884 0.1684096 0.1655673 0.2674647 factor(week)11 0.1668450 0.1665177 0.1616748 0.1638169 factor(week)11 factor(week)0 0.1668450 factor(week)2 0.1665177 factor(week)4 0.1616748 factor(week)6 0.1638169 factor(week)11 0.2525962 CM - array(0, dim=c(5*4/2, 5)) i1 - 0 for(i in 1:4)for(j in (i+1):5){ + i1 - i1+1 + CM[i1, c(i, j)] - c(-1, 1) + } CM [,1] [,2] [,3] [,4] [,5] [1,] -11000 [2,] -10100 [3,] -10010 [4,] -10001 [5,]0 -1100 [6,]0 -1010 [7,]0 -1001 [8,]00 -110 [9,]00 -101 [10,]000 -11 library(multcomp) csimint(par.week, df=denDF.week, covm=vc.week,cmatrix=CM) Simultaneous confidence intervals: user-defined contrasts 95 % confidence intervals Estimate 2.5 % 97.5 % [1,]0.180 -1.439 1.800 [2,] -1.436 -2.838 -0.034 [3,] -1.581 -2.995 -0.168 [4,] -1.580 -2.967 -0.193 [5,] -1.616 -3.123 -0.109 [6,] -1.762 -3.273 -0.250 [7,] -1.760 -3.244 -0.277 [8,] -0.146 -1.382 1.091 [9,] -0.144 -1.359 1.070 [10,]0.001 -1.206 1.209 csimtest(par.week, df=denDF.week, covm=vc.week,cmatrix=CM) Simultaneous tests: user-defined contrasts Contrast matrix: [,1] [,2] [,3] [,4] [,5] [1,] -11000 [2,] -10100 [3,] -10010 [4,] -10001 [5,]0 -1100 [6,]0 -1010 [7,]0 -1001 [8,]00 -110 [9,]00 -101 [10,]000 -11 Adjusted P-Values p adj [1,] 0.011 [2,] 0.013 [3,] 0.014 [4,] 0.015 [5,] 0.020 [6,] 0.024 [7,] 0.985 [8,] 0.985 [9,] 0.985 [10,] 0.997 sessionInfo() R version 2.2.1, 2005-12-20, i386-pc-mingw32 attached base packages: [1] methods stats graphics grDevices utils datasets [7] base other attached packages: multcompmvtnorm MASSstatmod nlme 0.4-80.7-2 7.2-241.2.4 3.1-68.1 If this does NOT answer your question (or even if it does), PLEASE do read the posting guide! www.R-project.org/posting-guide.html. I'd prefer not to have to guess whether you would think the example I chose was relevant. hope this helps, spencer graves Michaël Coeurdassier wrote: Dear R community, I performed a generalized linear mixed model using glmmPQL (MASS library) to analyse my data i.e : y is the response with a poisson distribution, t and Trait are the independent variables which are continuous and categorical (3 categories C, M and F) respectively, ind is the random variable. mydata-glmmPQL(y~t+Trait,random=~1|ind,family=poisson,data=tab) Do you think it is OK? Trait is significant (p 0.0001) and I would like to perform post-hoc comparisons to check where the difference among Trait
[R] lattice: calling functions
I defined three functions: fun0 - function( x=1:5, y=1:5, ... ) xyplot( y ~ x, ... ) fun1 - function( x=1:5, y=1:5, ... ) fun2( y ~ x, ... ) fun2 - function( ... ) xyplot( ... ) The call of fun0() works as expected. The call of fun1() causes the following error: 'Error in eval(expr, envir, enclos) : object y not found' How should I define fun2 to avoid the error? Thanks - Wolfram __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R and Power Point
On Feb 14, 2006, at 1:46 AM, Erin Hodgess wrote: I'm using R in a time series class. ... I have decided to put together Power Point slides for the teaching. ... I am currently saving the R screen as WMF files and inserting them into PowerPoint. While this works, it seems that there might be a simpler method. Hi Erin, For presentations I use LaTeX with beamer.cls and Sweave to access R. The results are legible and attractive. The method is not simple at first, since you must understand how to use beamer.cls and Sweave. But once you're in production mode, it's a delight. I'd be happy to share templates. _ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Box 400400Charlottesville, VA 22904-4400 Parcels:Room 102Gilmer Hall McCormick RoadCharlottesville, VA 22903 Office:B011+1-434-982-4729 Lab:B019+1-434-982-4751 Fax:+1-434-982-4766 WWW:http://www.people.virginia.edu/~mk9y/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] lattice: calling functions
On 2/14/2006 8:56 AM, Wolfram Fischer wrote: I defined three functions: fun0 - function( x=1:5, y=1:5, ... ) xyplot( y ~ x, ... ) fun1 - function( x=1:5, y=1:5, ... ) fun2( y ~ x, ... ) fun2 - function( ... ) xyplot( ... ) The call of fun0() works as expected. The call of fun1() causes the following error: 'Error in eval(expr, envir, enclos) : object y not found' How should I define fun2 to avoid the error? fun2 is fine, it's fun1 that has problems. It is passing a formula through fun2 to xyplot without telling xyplot where to evaluate the arguments. If you change it to fun1 - function( x=1:5, y=1:5, ... ) fun2( y ~ x, data=enviroment(), ... ) it will tell xyplot to look in the current environment at the time of the call, i.e. the fun1 evaluation environment where x and y live. Duncan Murdoch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] How to handle large dataframes?
Dear all I imported a Stata .dta file with the read.dta-function from the foreign-package. The dataframe's dimensions are dim(d.apc) [1] 15806 1300 Importing needs up to 15 min and calculations with these data are rather slow (although I subset the data before starting analyses). My questions are: 1. Has someone experiences importing Stata files (alternatives to read.dta) ? 2. To my knowledge R should not have problems handling dataframes of this size. Is there something I can do after importing that makes data handling faster? My hardware is up-to-date (Intel P4, 3 Ghz, 1 GB RAM) and I work on a Windows XP platform. I am working on a Windows XP platform with R version 2.1 (all packages updated). Thanks for your answers. Christian -- Christian Bieli, project assistant Institute of Social and Preventive Medicine University of Basel, Switzerland Steinengraben 49 CH-4051 Basel Tel.: +41 61 270 22 12 Fax: +41 61 270 22 25 [EMAIL PROTECTED] www.unibas.ch/ispmbs __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R and Power Point
On 2/14/2006 9:08 AM, Michael Kubovy wrote: On Feb 14, 2006, at 1:46 AM, Erin Hodgess wrote: I'm using R in a time series class. ... I have decided to put together Power Point slides for the teaching. ... I am currently saving the R screen as WMF files and inserting them into PowerPoint. While this works, it seems that there might be a simpler method. Hi Erin, For presentations I use LaTeX with beamer.cls and Sweave to access R. The results are legible and attractive. The method is not simple at first, since you must understand how to use beamer.cls and Sweave. But once you're in production mode, it's a delight. I'd be happy to share templates. Please put some up on the web somewhere! I'm just learning beamer, and don't need it for R right now, but I'm sure I will eventually. Duncan Murdoch P.S. How do I add page numbers to slides? I see in the manual a section called The Headline and Footline that apparently tells me how to do it using an option [page number], but I don't see where to put that. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] lattice: calling functions
On 2/14/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 2/14/2006 8:56 AM, Wolfram Fischer wrote: I defined three functions: fun0 - function( x=1:5, y=1:5, ... ) xyplot( y ~ x, ... ) fun1 - function( x=1:5, y=1:5, ... ) fun2( y ~ x, ... ) fun2 - function( ... ) xyplot( ... ) The call of fun0() works as expected. The call of fun1() causes the following error: 'Error in eval(expr, envir, enclos) : object y not found' How should I define fun2 to avoid the error? fun2 is fine, it's fun1 that has problems. It is passing a formula through fun2 to xyplot without telling xyplot where to evaluate the arguments. If you change it to fun1 - function( x=1:5, y=1:5, ... ) fun2( y ~ x, data=enviroment(), ... ) it will tell xyplot to look in the current environment at the time of the call, i.e. the fun1 evaluation environment where x and y live. Although this does seem to be how xyplot works, I think it indicates there is a problem with it. The help file for xyplot indicates that for the xyplot formula method the default environment is the caller environment whereas it ought to be the environment of the formula: data: For the 'formula' method, a data frame containing values for any variables in the formula, as well as 'groups' and 'subset' if applicable. By default the environment where the function was called from is used. For example, if we replace xyplot with lm it does work as expected: fun1 - function( x=1:5, y=1:5, ... ) fun2( y ~ x, ... ) fun2 - function( ... ) lm( ... ) fun1() __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] R, AMD Opteron 64, and Rmpi
Dear All, I found Andy Liaw's suggestion about using a NUMA (instead of SMP) kernel when running R on amd64 with 1 CPU http://finzi.psych.upenn.edu/R/Rhelp02a/archive/35109.html A couple of questions: 1. Is this still the case with the newer dual-core opterons (e.g., the 275 et al., families) running Linux (kernel 2.6)? 2. How does this affect using Rmpi (and snow, papply, et al.) on multi-server clusters with 1 CPU? If I understand correctly, and if the situation is what Andy described, if we use a SMP kernel we will suffer a within-node penalty in one of the Rmpi processes. Is this correct? Thanks, R. -- Ramón Díaz-Uriarte Bioinformatics Unit Centro Nacional de Investigaciones Oncológicas (CNIO) (Spanish National Cancer Center) Melchor Fernández Almagro, 3 28029 Madrid (Spain) Fax: +-34-91-224-6972 Phone: +-34-91-224-6900 http://ligarto.org/rdiaz PGP KeyID: 0xE89B3462 (http://ligarto.org/rdiaz/0xE89B3462.asc) **NOTA DE CONFIDENCIALIDAD** Este correo electrónico, y en s...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] lattice: calling functions
On 2/14/2006 9:38 AM, Gabor Grothendieck wrote: On 2/14/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 2/14/2006 8:56 AM, Wolfram Fischer wrote: I defined three functions: fun0 - function( x=1:5, y=1:5, ... ) xyplot( y ~ x, ... ) fun1 - function( x=1:5, y=1:5, ... ) fun2( y ~ x, ... ) fun2 - function( ... ) xyplot( ... ) The call of fun0() works as expected. The call of fun1() causes the following error: 'Error in eval(expr, envir, enclos) : object y not found' How should I define fun2 to avoid the error? fun2 is fine, it's fun1 that has problems. It is passing a formula through fun2 to xyplot without telling xyplot where to evaluate the arguments. If you change it to fun1 - function( x=1:5, y=1:5, ... ) fun2( y ~ x, data=enviroment(), ... ) it will tell xyplot to look in the current environment at the time of the call, i.e. the fun1 evaluation environment where x and y live. Although this does seem to be how xyplot works, I think it indicates there is a problem with it. The help file for xyplot indicates that for the xyplot formula method the default environment is the caller environment whereas it ought to be the environment of the formula: data: For the 'formula' method, a data frame containing values for any variables in the formula, as well as 'groups' and 'subset' if applicable. By default the environment where the function was called from is used. For example, if we replace xyplot with lm it does work as expected: fun1 - function( x=1:5, y=1:5, ... ) fun2( y ~ x, ... ) fun2 - function( ... ) lm( ... ) fun1() You're right, I forgot formulas have associated environments. I've added the lattice maintainer to the cc list. Duncan Murdoch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How to handle large dataframes?
I think it is well worth the effort to start using a database system like e.g. MySql for such purposes. If you look at http://gbi.agrsci.dk/~sorenh/misc/R-SAS-MySql/R-SAS-MySql.html then you'll find a short - and rudimentary - description of how to use MySql in connection with R and SAS (on Windows). The time you'll have to spend to get it up and running (about 30 minutes) is well spent. I suppose you can take your stata data and save as a comma separate file. Such a file is easy to put into a MySql database (although I haven't written how). Perhaps Stata can connect directly to MySql? Best regards Søren Fra: [EMAIL PROTECTED] på vegne af Christian Bieli Sendt: ti 14-02-2006 15:24 Til: R help list Emne: [R] How to handle large dataframes? Dear all I imported a Stata .dta file with the read.dta-function from the foreign-package. The dataframe's dimensions are dim(d.apc) [1] 15806 1300 Importing needs up to 15 min and calculations with these data are rather slow (although I subset the data before starting analyses). My questions are: 1. Has someone experiences importing Stata files (alternatives to read.dta) ? 2. To my knowledge R should not have problems handling dataframes of this size. Is there something I can do after importing that makes data handling faster? My hardware is up-to-date (Intel P4, 3 Ghz, 1 GB RAM) and I work on a Windows XP platform. I am working on a Windows XP platform with R version 2.1 (all packages updated). Thanks for your answers. Christian -- Christian Bieli, project assistant Institute of Social and Preventive Medicine University of Basel, Switzerland Steinengraben 49 CH-4051 Basel Tel.: +41 61 270 22 12 Fax: +41 61 270 22 25 [EMAIL PROTECTED] www.unibas.ch/ispmbs __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How to handle large dataframes?
do you want to use the dataset as it is? if not, it might be better save the data into a database, such as sqlite, and then odbc to it? Then you can use sql to only fetch the data you want for analysis. On 2/14/06, Christian Bieli [EMAIL PROTECTED] wrote: Dear all I imported a Stata .dta file with the read.dta-function from the foreign-package. The dataframe's dimensions are dim(d.apc) [1] 15806 1300 Importing needs up to 15 min and calculations with these data are rather slow (although I subset the data before starting analyses). My questions are: 1. Has someone experiences importing Stata files (alternatives to read.dta) ? 2. To my knowledge R should not have problems handling dataframes of this size. Is there something I can do after importing that makes data handling faster? My hardware is up-to-date (Intel P4, 3 Ghz, 1 GB RAM) and I work on a Windows XP platform. I am working on a Windows XP platform with R version 2.1 (all packages updated). Thanks for your answers. Christian -- Christian Bieli, project assistant Institute of Social and Preventive Medicine University of Basel, Switzerland Steinengraben 49 CH-4051 Basel Tel.: +41 61 270 22 12 Fax: +41 61 270 22 25 [EMAIL PROTECTED] www.unibas.ch/ispmbs __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- WenSui Liu (http://statcompute.blogspot.com) Senior Decision Support Analyst Health Policy and Clinical Effectiveness Cincinnati Children Hospital Medical Center [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How to handle large dataframes?
Soren's suggestion is the right way to go provided you don't need all the data all the time. Another thing to try is once the data is imported, convert the numeric part of the data frame to a matrix, as calculations on a matrix are much faster than calculations on a data frame. I'm too lazy to convert my data frames to matrix form, I program during the day and let my computer do most of the calculations overnight. HTH, Roger On 2/14/06, Søren Højsgaard [EMAIL PROTECTED] wrote: I think it is well worth the effort to start using a database system like e.g. MySql for such purposes. If you look at http://gbi.agrsci.dk/~sorenh/misc/R-SAS-MySql/R-SAS-MySql.html then you'll find a short - and rudimentary - description of how to use MySql in connection with R and SAS (on Windows). The time you'll have to spend to get it up and running (about 30 minutes) is well spent. I suppose you can take your stata data and save as a comma separate file. Such a file is easy to put into a MySql database (although I haven't written how). Perhaps Stata can connect directly to MySql? Best regards Søren Fra: [EMAIL PROTECTED] på vegne af Christian Bieli Sendt: ti 14-02-2006 15:24 Til: R help list Emne: [R] How to handle large dataframes? Dear all I imported a Stata .dta file with the read.dta-function from the foreign-package. The dataframe's dimensions are dim(d.apc) [1] 15806 1300 Importing needs up to 15 min and calculations with these data are rather slow (although I subset the data before starting analyses). My questions are: 1. Has someone experiences importing Stata files (alternatives to read.dta) ? 2. To my knowledge R should not have problems handling dataframes of this size. Is there something I can do after importing that makes data handling faster? My hardware is up-to-date (Intel P4, 3 Ghz, 1 GB RAM) and I work on a Windows XP platform. I am working on a Windows XP platform with R version 2.1 (all packages updated). Thanks for your answers. Christian -- Christian Bieli, project assistant Institute of Social and Preventive Medicine University of Basel, Switzerland Steinengraben 49 CH-4051 Basel Tel.: +41 61 270 22 12 Fax: +41 61 270 22 25 [EMAIL PROTECTED] www.unibas.ch/ispmbs __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Extracting Data form Simpleboot Output
Thank you for the perfect solution. Uwe Ligges wrote: Terry W. Schulz wrote: Hello, I am new to R, so forgive my ignorance on what is probably simple. I find package simpleboot quite useful for LOESS bootstrapping and generation of plots. I want to calculate the standard error for x=60 of the 100 grid points and 50 bootstraps. The code below gives the first fitted value. How can I grab the other 49 values easily? I could do it one at a time for 50 bootstraps, but this becomes tedious for say 2000 bootstraps. Thanks for any help. library(simpleboot) library(bootstrap) attach(cholost) set.seed(13579) lo - loess(y ~ z, data=cholost, span=.5, degree=2, family=gaussian, method=loess) lo.b - loess.boot(lo, R=50, rows = TRUE, new.xpts = NULL, ngrid = 100, weights = NULL) lo.b$boot.list$1$fitted[60] sapply(lo.b$boot.list, function(x) x$fitted) gives you the corresponding 100x50 matrix ... Uwe Ligges -- Terry W. Schulz Applied Statistician 1218 Pomegranate Lane Golden, CO 80401 [EMAIL PROTECTED] (303) 526-1461 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Using optim() with a function which returns more than a scalar - alternatives?
I want to numerically maximize a function with optim (maximization over several arguments). optim() needs a function which returns a scalar only. However, it could be nice to be able to take other things out from the function as well. I'tried to create an attribute to the scalar with what I want to take out, but that attribute disappears in optim(). I looked into the code to see if it could (easily) be modified such that it could work on a function which returns e.g. a list or a vector (and then it should be maximized over the first element). But I gave up... Any suggestion will be appreciated... Best regards Søren __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] A concrete type I/III Sum of square problem
Thanks Brian for the reference. I just discover that it is available in our library so I going to take it read it soon. Actually, I don't even know the difference between a multistratum vs a single-stratum AOV. A quick search on google returned me the R materials so that I imagine that these concepts are quite specific to R. I will read the book first before asking for more informations. Thanks Sylvain Clément At 12:38 14/02/2006, you wrote: More to the point, you are confusing multistratum AOV with single-stratuam AOV. For a good tutorial, see MASS4 (bibliographic information in the R FAQ). For unbalanced data we suggest you use lme() instead. -- Brian D. Ripley, [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Inf values in a matrix
Hello, I have some Inf values in a matrix, but I don't want to replace them with some value but rather remove the rows that contain the Inf values. Also I would like to record the rows which were removed. Is there an easy way to do this instead of writing loops over the matrix? Thanks. Ita Cirovic Donev __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R and Power Point
Erin, From an Rgui graphics window (windows() device), Ctrl-W will save the current graph to the clipboard as a metafile; Ctrl-C will save as a bitmap. In PPt, Ctrl-V will paste either into a blank spot on a slide. The metafile is a Windows vector spec that will be sharper and smaller. However, I have had trouble when viewing them on different PCs with different fonts installed. Bitmaps will get around that but have all the usual limitations of ... bitmaps. MHP Erin Hodgess wrote on 2/14/2006 1:46 AM: Dear R People: I'm using R in a time series class. This class is being broadcast live to 2 remote sites via closed circuit TV. My people at the remote sites are having a terrible time seeing the computer screen as it is broadcast(resolution issues). I have decided to put together Power Point slides for the teaching. I am currently saving the R screen as WMF files and inserting them into PowerPoint. While this works, it seems that there might be a simpler method. Does anyone have any suggestions for the Power Point, please? Thanks so much! R Version 2.2.1 Windows Sincerely, Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Michael H. Prager, Ph.D. Population Dynamics Team NOAA Center for Coastal Habitat and Fisheries Research NMFS Southeast Fisheries Science Center Beaufort, North Carolina 28516 USA http://shrimp.ccfhrb.noaa.gov/~mprager/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Using optim() with a function which returns more than a scalar - alternatives?
Søren Højsgaard wrote: I want to numerically maximize a function with optim (maximization over several arguments). optim() needs a function which returns a scalar only. However, it could be nice to be able to take other things out from the function as well. I'tried to create an attribute to the scalar with what I want to take out, but that attribute disappears in optim(). I looked into the code to see if it could (easily) be modified such that it could work on a function which returns e.g. a list or a vector (and then it should be maximized over the first element). But I gave up... Any suggestion will be appreciated... Have your function return a scalar value and any additional data in an attribute, and then optimise. Then call your function one more time using the resulting parameters found by optim(), and you'll get the attributes. Pro: No need to mess with the code of optim() Con: One more function call required. Probably not a problem since optim() will have called it a few times anyway. BArry __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R and Power Point
Hi Duncan, On Feb 14, 2006, at 9:26 AM, Duncan Murdoch wrote: On 2/14/2006 9:08 AM, Michael Kubovy wrote: On Feb 14, 2006, at 1:46 AM, Erin Hodgess wrote: I'm using R in a time series class. ... I have decided to put together Power Point slides for the teaching. ... I am currently saving the R screen as WMF files and inserting them into PowerPoint. While this works, it seems that there might be a simpler method. Hi Erin, For presentations I use LaTeX with beamer.cls and Sweave to access R. The results are legible and attractive. The method is not simple at first, since you must understand how to use beamer.cls and Sweave. But once you're in production mode, it's a delight. I'd be happy to share templates. Please put some up on the web somewhere! I'm just learning beamer, and don't need it for R right now, but I'm sure I will eventually. I'll do so soon, and let the list know. Before that, please ask, and I'll send you the .Rnw and .tex files. P.S. How do I add page numbers to slides? I see in the manual a section called The Headline and Footline that apparently tells me how to do it using an option [page number], but I don't see where to put that. \setbeamertemplate{footline}[page number] This works, but has side effects on the appearance of my theme (I use Warsaw) that I don't know yet how to deal with. _ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Box 400400Charlottesville, VA 22904-4400 Parcels:Room 102Gilmer Hall McCormick RoadCharlottesville, VA 22903 Office:B011+1-434-982-4729 Lab:B019+1-434-982-4751 Fax:+1-434-982-4766 WWW:http://www.people.virginia.edu/~mk9y/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R and Power Point
On 2/14/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 2/14/2006 9:08 AM, Michael Kubovy wrote: On Feb 14, 2006, at 1:46 AM, Erin Hodgess wrote: I'm using R in a time series class. ... I have decided to put together Power Point slides for the teaching. ... I am currently saving the R screen as WMF files and inserting them into PowerPoint. While this works, it seems that there might be a simpler method. Hi Erin, For presentations I use LaTeX with beamer.cls and Sweave to access R. The results are legible and attractive. The method is not simple at first, since you must understand how to use beamer.cls and Sweave. But once you're in production mode, it's a delight. I'd be happy to share templates. Please put some up on the web somewhere! I'm just learning beamer, and don't need it for R right now, but I'm sure I will eventually. Duncan Murdoch P.S. How do I add page numbers to slides? I see in the manual a section called The Headline and Footline that apparently tells me how to do it using an option [page number], but I don't see where to put that. A ten second - I have to run - cross my fingers that I'm correct reply: one way is to use pre-defined templates. Try to add \useoutertheme{infolines} which should give you a line of author, short title, date, and *frame* number. /Henrik __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R and Power Point
Erin Hodgess [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am currently saving the R screen as WMF files and inserting them into PowerPoint. While this works, it seems that there might be a simpler method. Does anyone have any suggestions for the Power Point, please? Instead of saving to a file first, have you tried cutting from R and pasting directly to PowerPoint? File | Copy to Clipboard | As a Metafile Paste onto PowerPoint page In PowerPoint, the graphic has no background. Set a background color (if desired): Right click on graphic | Format Picture | Colors and Lines | Fill | Change from No Fill to white, or desired background color Sometimes resizing even with a metafile is a problem in PowerPoint (or Word). Drawing the right size in R before cutting and pasting often solves that problem. For some very complicated graphics (e.g., a large heatmap), use Copy to Clipboard | As a Bitmap to avoid delays in redrawing the graphic whenever the page is shown. efg __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R and Power Point
On 2/14/2006 11:12 AM, Henrik Bengtsson wrote: On 2/14/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 2/14/2006 9:08 AM, Michael Kubovy wrote: On Feb 14, 2006, at 1:46 AM, Erin Hodgess wrote: I'm using R in a time series class. ... I have decided to put together Power Point slides for the teaching. ... I am currently saving the R screen as WMF files and inserting them into PowerPoint. While this works, it seems that there might be a simpler method. Hi Erin, For presentations I use LaTeX with beamer.cls and Sweave to access R. The results are legible and attractive. The method is not simple at first, since you must understand how to use beamer.cls and Sweave. But once you're in production mode, it's a delight. I'd be happy to share templates. Please put some up on the web somewhere! I'm just learning beamer, and don't need it for R right now, but I'm sure I will eventually. Duncan Murdoch P.S. How do I add page numbers to slides? I see in the manual a section called The Headline and Footline that apparently tells me how to do it using an option [page number], but I don't see where to put that. A ten second - I have to run - cross my fingers that I'm correct reply: one way is to use pre-defined templates. Try to add \useoutertheme{infolines} which should give you a line of author, short title, date, and *frame* number. Thanks. That gives a bit more than I want, but it gives me some leads to go fixing things... Duncan Murdoch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R and Power Point
Erin, Another option. I'm saving R screens as postscript files, opening them in Ghostview and copying and pasting to blank slides in Powerpoint. I can't detect any deterioration in quality. Convenient when you have a lot of slides to make in a hurry. Ghostview and Ghostscript (required to run Ghostview) are freeware on the web. Duncan Murdoch wrote: On 2/14/2006 9:08 AM, Michael Kubovy wrote: On Feb 14, 2006, at 1:46 AM, Erin Hodgess wrote: I'm using R in a time series class. ... I have decided to put together Power Point slides for the teaching. ... I am currently saving the R screen as WMF files and inserting them into PowerPoint. While this works, it seems that there might be a simpler method. Hi Erin, For presentations I use LaTeX with beamer.cls and Sweave to access R. The results are legible and attractive. The method is not simple at first, since you must understand how to use beamer.cls and Sweave. But once you're in production mode, it's a delight. I'd be happy to share templates. Please put some up on the web somewhere! I'm just learning beamer, and don't need it for R right now, but I'm sure I will eventually. Duncan Murdoch P.S. How do I add page numbers to slides? I see in the manual a section called The Headline and Footline that apparently tells me how to do it using an option [page number], but I don't see where to put that. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Terry W. Schulz Applied Statistician 1218 Pomegranate Lane Golden, CO 80401 [EMAIL PROTECTED] (303) 526-1461 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Inf values in a matrix
try the following: mat - matrix(rnorm(40), 10, 4) mat[sample(20, 5)] - Inf mat ## index - rowSums(!is.finite(mat)) = 1 mat. - mat[!index, ] which(index) mat. I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://www.med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Tuesday, February 14, 2006 5:01 PM Subject: [R] Inf values in a matrix Hello, I have some Inf values in a matrix, but I don't want to replace them with some value but rather remove the rows that contain the Inf values. Also I would like to record the rows which were removed. Is there an easy way to do this instead of writing loops over the matrix? Thanks. Ita Cirovic Donev __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] A concrete type I/III Sum of square problem
WPhantom [EMAIL PROTECTED] writes: Thanks Brian for the reference. I just discover that it is available in our library so I going to take it read it soon. Actually, I don't even know the difference between a multistratum vs a single-stratum AOV. A quick search on google returned me the R materials so that I imagine that these concepts are quite specific to R. You have to be careful not to confuse Google's view of the world with Reality... The concept of error strata is much older than R, and existed for instance in Genstat, anno 1977 or so. However, Genstat seems to have left little impression on the Internet. I will read the book first before asking for more informations. The executive summary is that the concept of error strata relies substantially on having a balanced design (at least for the random effects), so that the analysis can be decomposed into analyses of means, contrasts, and contrasts of means. For unbalanced designs, you usually get meaningless analyses. Thanks Sylvain Clément At 12:38 14/02/2006, you wrote: More to the point, you are confusing multistratum AOV with single-stratuam AOV. For a good tutorial, see MASS4 (bibliographic information in the R FAQ). For unbalanced data we suggest you use lme() instead. -- Brian D. Ripley, [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Inf values in a matrix
Hi see ?is.infinite ?which something like y - x[-which(is.infinite(x), arr.ind=T)[,1],] y.removed -x[which(is.infinite(x), arr.ind=T)[,1],] shall make the trick. On 14 Feb 2006 at 17:01, [EMAIL PROTECTED] wrote: To: r-help@stat.math.ethz.ch From: [EMAIL PROTECTED] Date sent: Tue, 14 Feb 2006 17:01:12 +0100 Subject:[R] Inf values in a matrix Hello, I have some Inf values in a matrix, but I don't want to replace them with some value but rather remove the rows that contain the Inf values. Also I would like to record the rows which were removed. Is there an easy way to do this instead of writing loops over the matrix? Thanks. Ita Cirovic Donev __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Petr Pikal [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Inf values in a matrix
[EMAIL PROTECTED] wrote: Hello, I have some Inf values in a matrix, but I don't want to replace them with some value but rather remove the rows that contain the Inf values. Also I would like to record the rows which were removed. Is there an easy way to do this instead of writing loops over the matrix? Thanks. Ita Cirovic Donev __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Example: A - matrix(1:100, 10) A[cbind(3:4, 5:6)] - Inf recorded - which(apply(A, 1, function(x) any(is.infinite(x A[-recorded,] Uwe Ligges __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] R and Power Point
On 2/14/06, Duncan Murdoch [EMAIL PROTECTED] wrote: On 2/14/2006 9:08 AM, Michael Kubovy wrote: On Feb 14, 2006, at 1:46 AM, Erin Hodgess wrote: I'm using R in a time series class. ... I have decided to put together Power Point slides for the teaching. ... I am currently saving the R screen as WMF files and inserting them into PowerPoint. While this works, it seems that there might be a simpler method. Hi Erin, For presentations I use LaTeX with beamer.cls and Sweave to access R. The results are legible and attractive. The method is not simple at first, since you must understand how to use beamer.cls and Sweave. But once you're in production mode, it's a delight. I'd be happy to share templates. Please put some up on the web somewhere! I'm just learning beamer, and don't need it for R right now, but I'm sure I will eventually. I recently packaged up a small example for someone else; it's still available at http://www.stat.wisc.edu/~deepayan/R/gridbasics.zip YMMV. Deepayan __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Turning control back over to the terminal
Hi Ross -- Not a direct answer to your question, but here's an idea. I guess you've got some script in a file batch.sh #! /bin/bash R --no-save --no-restore --gui=none `hostname` 21 BYE # some mpi commands # other mpi commands BYE and you do something like mpiexec -np 10 batch.sh Instead, you might create a file script.R script.R library(Rmpi) mpi.spawn.Rslaves(nslaves=10) variousCmds - function() { ## some mpi commands if( mpi.comm.rank() == 0 interactive()) { while( (res - readline( prompt= )) != DONE ) { try(cat(eval(parse(text=res)), \n)) ## or other, e.g., browser() } } ## other mpi commands } mpi.bcast.Robj2slave( variousCmds ) mpi.bcast.cmd( variousCmds()) variousCmds() mpi.close.Rslaves() Then just run R and source(script.R) to debug, and R --vanilla script.R to run. This assumes that the 'some' and 'other' mpi commands include communication of results between nodes, so that you don't have to rely on the the return value of variousCmds to harvest the results. This could be great fun, because you can edit the script file (in emacs, for e.g.) and rerun without exiting R. http://ace.acadiau.ca/math/ACMMaC/Rmpi/index.html provided some inspiration for this, thanks! Martin Ross Boylan [EMAIL PROTECTED] writes: I'm invoking R from withing a shell script like this R --no-save --no-restore --gui=none `hostname` 21 BYE # various commands here BYE I would like to regain control from the invoking terminal at some point. I tried source(stdin()) but got a syntax error, presumably stdin is the little shell here snippet (the part between BYE and BYE). Is there some way to accomplish this? I am trying to regain control inside an R session that has been launched inside an MPI environment (and I'm usually running inside emacs). This is on a Mac OS X cluster. I suppose there might be a way to do this with expect, but I'm hoping for something simpler. Potentially, I could make the script itself act differently on the head node (the only one I want to debug right now), including changing the redirection there. -- Ross Boylan wk: (415) 514-8146 185 Berry St #5700 [EMAIL PROTECTED] Dept of Epidemiology and Biostatistics fax: (415) 514-8150 University of California, San Francisco San Francisco, CA 94107-1739 hm: (415) 550-1062 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] how to add the 95% confidence bands for the normal QQ plot?
I had the problem to do this. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] read.table
Hi it appears to me that read.table is very slow for reading large data files (mine are 200,000 rows). Is there a better way? Thanks! Max -- Maximilian O. Kauer, Ph.D. Department of Genetics, White lab 333 Cedar St, NSB 386 PO Box 208005 New Haven, CT 06510 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] read.table
?scan is much faser. Also, read.table has a colClasses optional argument which can be used to speed up the reading of large files significantly. read.table has a pretty good help section well worth reading. read.table(file, header = FALSE, sep = , quote = \', dec = ., row.names, col.names, as.is = FALSE, na.strings = NA, colClasses = NA, nrows = -1, skip = 0, check.names = TRUE, fill = !blank.lines.skip, strip.white = FALSE, blank.lines.skip = TRUE, comment.char = #, allowEscapes = FALSE) 2006/2/14, Max Kauer [EMAIL PROTECTED]: Hi it appears to me that read.table is very slow for reading large data files (mine are 200,000 rows). Is there a better way? Thanks! Max -- Maximilian O. Kauer, Ph.D. Department of Genetics, White lab 333 Cedar St, NSB 386 PO Box 208005 New Haven, CT 06510 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] figs parameter for split.screen()
Dear all, I would be pleased if anyone could help me. The Rhelp description for the figs parameter is a two-element vector describing the number of rows and colunns in a screen matrix. So, why does my code (below) produce a 2x1 screen matrix instead of a 1x2 one? Thanks in advance, rodrigo. --- plot.new() split.screen(figs=c(1,2)) screen(1) plot.new() plot(v16[vd==0], vdep[vd==0], bg=aliceblue, cex= 0.5, xlab=Age,ylab=AvWei, main=, ylim=c(x1,xn), cex.lab=1.1) title(main = Female, cex.main = 1.1 , font.main = 1, col.main = black) screen(2) plot.new() plot(v16[vd==1], vdep[vd==1], bg=aliceblue, cex= 0.5, xlab=Age,ylab=AvWei, main=, ylim=c(x1,xn), cex.lab=1.1) title(main = Male, cex.main = 1.1 , font.main = 1, col.main = black) *--- * ** [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] R/Splus April course *** (Raleigh, Miami, Houston, Baltimore etc) R/Splus Fundamentals and Programming Techniques
XLSolutions Corporation (www.xlsolutions-corp.com) is proud to announce 2-day R/S-plus Fundamentals and Programming Techniques in San Francisco: www.xlsolutions-corp.com/Rfund.htm Raleigh,April 3-4 Miami, April 10-11 Houston,April 13-14 Boston, April 20-21 Baltimore, April 27-28 Reserve your seat now at the early bird rates! Payment due AFTER the class Course Description: This two-day beginner to intermediate R/S-plus course focuses on a broad spectrum of topics, from reading raw data to a comparison of R and S. We will learn the essentials of data manipulation, graphical visualization and R/S-plus programming. We will explore statistical data analysis tools,including graphics with data sets. How to enhance your plots, build your own packages (librairies) and connect via ODBC,etc. We will perform some statistical modeling and fit linear regression models. Participants are encouraged to bring data for interactive sessions With the following outline: - An Overview of R and S - Data Manipulation and Graphics - Using Lattice Graphics - A Comparison of R and S-Plus - How can R Complement SAS? - Writing Functions - Avoiding Loops - Vectorization - Statistical Modeling - Project Management - Techniques for Effective use of R and S - Enhancing Plots - Using High-level Plotting Functions - Building and Distributing Packages (libraries) - Connecting; ODBC, Rweb, Orca via sockets and via Rjava Email us for group discounts. Email Sue Turner: [EMAIL PROTECTED] Phone: 206-686-1578 Visit us: www.xlsolutions-corp.com/training.htm Please let us know if you and your colleagues are interested in this classto take advantage of group discount. Register now to secure your seat! Interested in R/Splus Advanced course? email us. Cheers, Elvis Miller, PhD Manager Training. XLSolutions Corporation 206 686 1578 www.xlsolutions-corp.com [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Legend in a HeatMap
List, Is it possible to add a color legend to a heatmap , similar to the one in levelplot and filled.contour plot. The legend will represent the colors used in the heatmap along with values for each color range. Can this be done? Please help. Thanks, Svakki. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] figs parameter for split.screen()
On Tue, 14 Feb 2006, Rodrigo Tsai wrote: Dear all, I would be pleased if anyone could help me. The Rhelp description for the figs parameter is a two-element vector describing the number of rows and colunns in a screen matrix. So, why does my code (below) produce a 2x1 screen matrix instead of a 1x2 one? Does it? There is no way we can reproduce it as it is incomplete, but split.screen(figs=c(1,2)) screen(1) plot(1:2) screen(2) plot(10:1) does produce a 1x2 layout. Perhaps your error is call plot.new() in a subdivided layout: it makes no sense to select a screen and then move to the next frame. Thanks in advance, rodrigo. --- plot.new() split.screen(figs=c(1,2)) screen(1) plot.new() plot(v16[vd==0], vdep[vd==0], bg=aliceblue, cex= 0.5, xlab=Age,ylab=AvWei, main=, ylim=c(x1,xn), cex.lab=1.1) title(main = Female, cex.main = 1.1 , font.main = 1, col.main = black) screen(2) plot.new() plot(v16[vd==1], vdep[vd==1], bg=aliceblue, cex= 0.5, xlab=Age,ylab=AvWei, main=, ylim=c(x1,xn), cex.lab=1.1) title(main = Male, cex.main = 1.1 , font.main = 1, col.main = black) *--- * ** [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] figs parameter for split.screen()
Dear Prof Brian Ripley, Many thanks for your help. Before trying to split.screen (1x2) I had set the mar parameter in par( ) in order to move each graph of another (2x1) splitted figure. This setting might have caused the problem. Now it works. Best regards, Rodrigo. On 2/14/06, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Tue, 14 Feb 2006, Rodrigo Tsai wrote: Dear all, I would be pleased if anyone could help me. The Rhelp description for the figs parameter is a two-element vector describing the number of rows and colunns in a screen matrix. So, why does my code (below) produce a 2x1 screen matrix instead of a 1x2 one? Does it? There is no way we can reproduce it as it is incomplete, but split.screen(figs=c(1,2)) screen(1) plot(1:2) screen(2) plot(10:1) does produce a 1x2 layout. Perhaps your error is call plot.new() in a subdivided layout: it makes no sense to select a screen and then move to the next frame. Thanks in advance, rodrigo. --- plot.new() split.screen(figs=c(1,2)) screen(1) plot.new() plot(v16[vd==0], vdep[vd==0], bg=aliceblue, cex= 0.5, xlab=Age,ylab=AvWei, main=, ylim=c(x1,xn), cex.lab=1.1) title(main = Female, cex.main = 1.1 , font.main = 1, col.main = black) screen(2) plot.new() plot(v16[vd==1], vdep[vd==1], bg=aliceblue, cex= 0.5, xlab=Age,ylab=AvWei, main=, ylim=c(x1,xn), cex.lab=1.1) title(main = Male, cex.main = 1.1 , font.main = 1, col.main = black) *--- * ** [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] figs parameter for split.screen()
You may find that ?layout is an easier way to handle multiple plots on the screen (I do), if you are not already aware of it. -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA The business of the statistician is to catalyze the scientific learning process. - George E. P. Box -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rodrigo Tsai Sent: Tuesday, February 14, 2006 1:31 PM To: Prof Brian Ripley Cc: R-help@stat.math.ethz.ch Subject: Re: [R] figs parameter for split.screen() Dear Prof Brian Ripley, Many thanks for your help. Before trying to split.screen (1x2) I had set the mar parameter in par( ) in order to move each graph of another (2x1) splitted figure. This setting might have caused the problem. Now it works. Best regards, Rodrigo. On 2/14/06, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Tue, 14 Feb 2006, Rodrigo Tsai wrote: Dear all, I would be pleased if anyone could help me. The Rhelp description for the figs parameter is a two-element vector describing the number of rows and colunns in a screen matrix. So, why does my code (below) produce a 2x1 screen matrix instead of a 1x2 one? Does it? There is no way we can reproduce it as it is incomplete, but split.screen(figs=c(1,2)) screen(1) plot(1:2) screen(2) plot(10:1) does produce a 1x2 layout. Perhaps your error is call plot.new() in a subdivided layout: it makes no sense to select a screen and then move to the next frame. Thanks in advance, rodrigo. --- plot.new() split.screen(figs=c(1,2)) screen(1) plot.new() plot(v16[vd==0], vdep[vd==0], bg=aliceblue, cex= 0.5, xlab=Age,ylab=AvWei, main=, ylim=c(x1,xn), cex.lab=1.1) title(main = Female, cex.main = 1.1 , font.main = 1, col.main = black) screen(2) plot.new() plot(v16[vd==1], vdep[vd==1], bg=aliceblue, cex= 0.5, xlab=Age,ylab=AvWei, main=, ylim=c(x1,xn), cex.lab=1.1) title(main = Male, cex.main = 1.1 , font.main = 1, col.main = black) *--- * ** [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Installing packages without clicking
I need to install several (too many) packages from local *.zip files. is there any form to do it without clicking? I'm asking for a R code that allow me perform these task. --- Mario Alfonso Morales Rivera. Profesor Asistente. Departamento de Matemáticas y estadística. Universidad de Córdoba. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Installing packages without clicking
On Tue, 14 Feb 2006, Mario Alfonso Morales Rivera wrote: I need to install several (too many) packages from local *.zip files. is there any form to do it without clicking? I'm asking for a R code that allow me perform these task. See ?install.packages. You seem to be using Windows (you did not say). So the help page says repos: character vector, the base URL(s) of the repositories to use, i.e., the URL of the CRAN master such as 'http://cran.r-project.org;' or its Statlib mirror, 'http://lib.stat.cmu.edu/R/CRAN;'. Can be 'NULL' to install from local '.zip' files. and so all you need is install.packages(c(my1.zip, my2.zip), repos = NULL) -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Installing packages without clicking
I need to install several (too many) packages from local *.zip files. Are you aware of being able to select multiple .zip files at one time using SHIFT-click or CTRL-click? is there any form to do it without clicking? I'm asking for a R code that allow me perform these task. You could just do what the clicking does, i.e. call the function install.packages() with appropriate parameters. See utils:::menuInstallLocal Hope this helps, Ray Brownrigg __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Assumption in Bassic Tobit regression
Is it assumption Tobit regression like OLS ? : 1. Normal 2. No autocorrelation 3. Homogeneity of variance 4. No Multicolinearity please make sure me ! I need answer because i want to Judisium/ kompre/thesis test __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Assumption in Bassic Tobit regression
On Wed, 15 Feb 2006 05:15:28 +0700 bambang pramono wrote: Is it assumption Tobit regression like OLS ? : 1. Normal 2. No autocorrelation 3. Homogeneity of variance 4. No Multicolinearity please make sure me ! I need answer because i want to Judisium/ kompre/thesis test This is the third time you ask the same question and it did not get more meaningful! Please consult an econometrics textbook (e.g. Greene or Cameron Trivedi) for the theoretical background of tobit models. Concerning available R implementations of various tobit flavours, you have already been pointed to a useful thread in the mailing list archives. Z __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How to generate a report with graphics and tables?
how do i perform the stuff i just recorded?! [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Simple network diagram
Hello, I'm trying to create a simple network diagram like that on http://www.pauck.de/marco/photo/infrared/comparison_of_films/diagram3.gif. Unfortunately I've not yet found any function that could do this. I think this should not be a difficult task since I only need two vectors and perhaps the names of the dimensions as data source. Could somebody help me please? Greetings, -Rainer __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] analysis of residual sum of squares in R
Dear R-helpers, There's a method named as in this message's subject that has been proposed by: Chen Y, Jackson DA, Harvey HH (1992) A comparison of von Bertalanffy and polynomial functions in modelling fish growth data. Canadian Journal of Fisheries and Aquatic Sciences 49:1228-1235. which is used to compare a group of non linear models. The method tests whether all the fitted curves describe the same population of data. The test is an F ratio: F = (RSSp - sum(RSSi) / DFp - sum(DFi)) / (sum(RSSi) / sum(DFi)) where the RSS and DF are the residual sum of squares and degrees of freedom, respectively. The 'p' and 'i' subscripts denote the pooled or each individual curve, respectively. If this procedure has already been implemented in a package, I'd be happy to hear about it. A search of the archives and other sources didn't help. Cheers, -- Sebastian Luque __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Update problems of Rcmdr?
Hi R users: I am not sure how do I fix it. But I erase an old R library installation (2.2.0), and also I erase all file directories on the R.2.2.1 library directory, and then I try library(Rcmdr) again and it works!. Any way, how could I trace or debug, so I get a hint whats going on with a similar problem in the future? Thank you very much for your help. Kenneth John Fox wrote: Dear Kenneth, After just running update.packages() myself, I can't duplicate this error (using R 2.2.1 under Win XP). Can you provide a little more information? Are any but the standard packages loaded when you issue the library(Rcmdr) command? Have you made any modifications to a startup file, such as Rprofile.site? I'm sorry that I can't offer any additional suggestions at this point. John John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kenneth Cabrera Sent: Monday, February 13, 2006 7:54 PM To: r-help@stat.math.ethz.ch Subject: [R] Update problems of Rcmdr? Importance: High Hi R users: I got this messages when I try to use the Rcmdr library, after I make an update with update.packages() command. I am using R221 in windows environment. library(Rcmdr) Loading required package: tcltk Loading Tcl/Tk interface ... done Loading required package: car Error in parse(file, n, text, prompt) : syntax error in * Error: .onAttach failed in 'attachNamespace' Error: package/namespace load failed for 'Rcmdr' Thank you for your help Kenneth __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Simple network diagram
Check out ?stars On 2/14/06, Rainer Hahnekamp [EMAIL PROTECTED] wrote: Hello, I'm trying to create a simple network diagram like that on http://www.pauck.de/marco/photo/infrared/comparison_of_films/diagram3.gif. Unfortunately I've not yet found any function that could do this. I think this should not be a difficult task since I only need two vectors and perhaps the names of the dimensions as data source. Could somebody help me please? Greetings, -Rainer __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] no convergence using lme
Hi. I was wondering if anyone might have some suggestions about how I can overcome a problem of iteration limit reached without convergence when fitting a mixed effects model. In this study: Outcome is a measure of heart action Age is continuous (in weeks) Gender is Male or Female (0 or 1) Genotype is Wild type or knockout (0 or 1) Animal is the Animal ID as a factor Gender.Age is Gender*Age Genotype.Age is Genotype*Age Gender.Genotype.Age is Gender*Genotype*Age If I have the intercept (but not the slope) as a random effect the fit converges OK fit1 - lme(Outcome~Age + Gender + Genotype + Gender.Age + Genotype.Age + Gender.Genotype.Age, random=~1|Animal, data=VC) If I have the slope (but not the intercept) as a random factor it converges OK fit2 - lme(LVDD~Age + Gender + Genotype + Gender.Age + Genotype.Age +Gender.Genotype.Age, random=~Age-1|Animal, data=VC) If I have both slope and intercept as random factors it won't converge fit3 - lme(LVDD~Age + Gender + Genotype + Gender.Age + Genotype.Age + Gender.Genotype.Age, random=~ Age|Animal, data=VC) Gives error: Error in lme.formula(LVDD ~ Age + Gender + Genotype + Gender.Age + Genotype.Age + : iteration limit reached without convergence (9) If I try to increase the number of iterations (even to 1000) by increasing maxIter it still doesn't converge fit - lme(LVDD~Age + Gender + Genotype + Gender.Age + Genotype.Age + Gender.Genotype.Age, + random=~ Age|Animal, data=VC, control=list(maxIter=1000, msMaxIter=1000, niterEM=1000)) NB. I changed maxIter value in isolation as well as together with two other controls with iter in their name (as shown above) just to be sure ( as I don't understand how the actual iterative fitting of the model works mathematically) I was wondering if anyone knew if there was anything else in the control values I should try changing. Below are the defaults.. lmeControl function (maxIter = 50, msMaxIter = 50, tolerance = 1e-06, niterEM = 25, msTol = 1e-07, msScale = lmeScale, msVerbose = FALSE, returnObject = FALSE, gradHess = TRUE, apVar = TRUE, .relStep = (.Machine$double.eps)^(1/3), minAbsParApVar = 0.05, nlmStepMax = 100, optimMethod = BFGS, natural = TRUE) I was reading on the R listserve that lmer from the lme4 package may be preferable to lme (for convergence problems) but lmer seems to need you to put in starting values and I'm not sure how to go about chosing them. I was wondering if anyone had experience with lmer that might help me with this? Thanks again for any advice you can provide. Regards Marg Dr Margaret Gardiner-Garden Garvan Institute of Medical Research 384 Victoria Street Darlinghurst Sydney NSW 2010 Australia Phone: 61 2 9295 8348 Fax: 61 2 9295 8321 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Update problems of Rcmdr?
Dear Kenneth, It's very difficult for me to tell from the information that you've given what the problem might have been. I'm glad, however, that things are working now. One thought: Do you have the R_LIBS environment variable set? If so, it's possible that you were picking up an old version of a package. Perhaps someone else will come up with a better explanation. Regards, John John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kenneth Cabrera Sent: Tuesday, February 14, 2006 7:05 PM To: John Fox Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Update problems of Rcmdr? Importance: High Hi R users: I am not sure how do I fix it. But I erase an old R library installation (2.2.0), and also I erase all file directories on the R.2.2.1 library directory, and then I try library(Rcmdr) again and it works!. Any way, how could I trace or debug, so I get a hint whats going on with a similar problem in the future? Thank you very much for your help. Kenneth John Fox wrote: Dear Kenneth, After just running update.packages() myself, I can't duplicate this error (using R 2.2.1 under Win XP). Can you provide a little more information? Are any but the standard packages loaded when you issue the library(Rcmdr) command? Have you made any modifications to a startup file, such as Rprofile.site? I'm sorry that I can't offer any additional suggestions at this point. John John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kenneth Cabrera Sent: Monday, February 13, 2006 7:54 PM To: r-help@stat.math.ethz.ch Subject: [R] Update problems of Rcmdr? Importance: High Hi R users: I got this messages when I try to use the Rcmdr library, after I make an update with update.packages() command. I am using R221 in windows environment. library(Rcmdr) Loading required package: tcltk Loading Tcl/Tk interface ... done Loading required package: car Error in parse(file, n, text, prompt) : syntax error in * Error: .onAttach failed in 'attachNamespace' Error: package/namespace load failed for 'Rcmdr' Thank you for your help Kenneth __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html