Re: [R] How can I test temporal autocorrelation of binary data?
Depending on what you are really want to infer from the autocorrelations, you want to consider the runs-test, too. HTH, Bernhard If you mean you want to test that there is no autocorrelation, then there is some information on using the Ljung-Box test on such data in the working paper 'Robustness of the Ljung-Box test and its rank equivalent' on the Burns Statistics website. The executive summary is that the test seems to do okay as long as one of the values is not too dominant. What 'dominant' means depends on the length of the series. If some one has a better answer, I'm keen to hear it. 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) [EMAIL PROTECTED] wrote: Hi, I have a binary (o/1 - coded) data set and want to test it's autocorrelation structure. Is that function implemented in R? Can I use the ACF - funtion with binary data? Thanks for your help, Daniel __ 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* Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. * __ 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] Help with try or tryCatch
On Mon, 31 Oct 2005, McGehee, Robert wrote: It sounds like you want `try` with the argument `silent = TRUE`. This will allow you to keep running your program without errors. If you want to check if the line had an error, you can error control by seeing if the class of the resulting object is try-error. For example, let's say I wanted to make an error-proof `plus` function, such that trying a + 2 would result in NA instead of an error. newPlus - function(x, y) { answer - try(x + y, silent = TRUE) if (class(answer) == try-error) return(NA) else return(answer) } This approach worked. I had to define a test function of this sort outside of the loops and then call it within the loops with appropriate parameter values. Thanks for the assistance. David Scott --- David Scott Department of Statistics, Tamaki Campus The University of Auckland, PB 92019 AucklandNEW ZEALAND Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000 Email: [EMAIL PROTECTED] Graduate Officer, Department of Statistics __ 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] R2WinBUGS: Comparison to WinBUGS
Hi R-Users! I know I posted the question before (see archives) but I have not been able to find the mistake. Again using R2WinBUGS and WinBUGS does not yield the same result (although to my opinion the commands are the same). The variance of the parameters is much bigger and the parameter estimates are a bit different, too. If anybody has the time and interest to get the files and data and see if he/she has the same problems, I would be happy to provide these (and to discuss it further). It seems though that it must be my mistake SOMEWHERE because nobody else reported any problems yet... Thanks. Hadassa -- Hadassa Brunschwig Birmannsgasse 10A CH-4055 Basel Switzerland Phone: +41 78 797 6065 Email: [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] line vector plots
Eduardo Klein wrote: Hi Jim, Thanks for the tip, but I really need the same polar chart but over a line no in a circle. I didn't find it on the plotrix package. Hmmm, are you looking for something like this? feather.plot-function(x,y,xpos,yref=0,use.arrows=FALSE,...) { if(missing(xpos)) xpos-1:length(x) xlim-range(x+xpos) ylim-range(y) plot(0,xlim=xlim,ylim=ylim,type=n) abline(h=yref) if(use.arrows) arrows(xpos,yref,xpos+x,y,length=0.1,...) else segments(xpos,yref,xpos+x,y,...) } where x and y are the components of the vectors and xpos is the positions on the time line? If so, I'll add that to plotrix - looks useful. Jim __ 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] standard errors in summary.lm
Dear R users, If I have an aov object, how are the standard errors of the estimates in summary.lm calculated? Using treatment contrasts, I would like to use the estimated differences in mean values (intercepts) to calculate the mean values per factor level, and for these mean values I´f like to use the model output to calculate the standard errors. Many thanks for your help! Regards, Christoph. __ 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 change label size in a plot
Dear all, I have created a plot like this: matrix-read.table(G:\\my documents\\names.txt,header=T) hc-hclust(dist(matrix)^2,cen) memb-cutree(hc,k=10) plot(hc,col=black) This prints out a dendrogram with labels, but the text of the labels is large, so they overlap and are unreadable. How can I decrease the size of the lable text on a dendrogram so that it does not overlap and is therefore readable? I know the question is similar to that posted by Michael Schmitt on 19 March 2005, but as far as I can see, the question was not answered. Many Thanks, Fiona Fíona Mc Cahey Department of Chemistry University of Cambridge Lensfield Road Cambridge, CB2 1EW __ 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] Doubly Non-Central F-Distribution
Hello All, Has anyone written a function for the distribution function of a *doubly* non-central F-distribution? I looked through the archives, but didn't find anything. Thanks! Wolfgang __ 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 Graphs in Powerpoint
Have you tried using Keynote? It is a part of iWork and handles pdf files properly (you can resize as many times as you want without loosing image quality). It also will convert to and from Power Point. I would highly recommend it to anyone using OS X. Randy On 10/31/05 6:14 PM, Jarrett Byrnes [EMAIL PROTECTED] wrote: Hey, all. Quick question. I'm attempting to use some of the great graphs generated in R for an upcoming talk that I'm writing in Powerpoint. Copying and pasting (I'm using OSX) yields graphs that look great in Powerpoint - until I resize them. Then fonts, points, and lines all become quite pixelated and blurry. Even if I size the window properly first, and then copy and paste in the graph, when I then view the slideshow, the graphs come out pixelated and blurry. Is there any good solution to this, or is this some fundamental incompatibility that I can't get around? -Jarrett __ 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 1050 Boyles Street 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] Help with try or tryCatch
Just a bit of nitpicking: I believe the preferred way is to see if the result of try() _inherits_ the try-error class. This applies to all S3 classes. I.e., the relevant line should be something like: if (inherits(answer, try-error)) ... Andy From: David Scott On Mon, 31 Oct 2005, McGehee, Robert wrote: It sounds like you want `try` with the argument `silent = TRUE`. This will allow you to keep running your program without errors. If you want to check if the line had an error, you can error control by seeing if the class of the resulting object is try-error. For example, let's say I wanted to make an error-proof `plus` function, such that trying a + 2 would result in NA instead of an error. newPlus - function(x, y) { answer - try(x + y, silent = TRUE) if (class(answer) == try-error) return(NA) else return(answer) } This approach worked. I had to define a test function of this sort outside of the loops and then call it within the loops with appropriate parameter values. Thanks for the assistance. David Scott --- David Scott Department of Statistics, Tamaki Campus The University of Auckland, PB 92019 AucklandNEW ZEALAND Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000 Email:[EMAIL PROTECTED] Graduate Officer, Department of Statistics __ 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] write.table call
RTFM, in particular the CSV Files section of ?write.table. BTW, R itself does not write xls files. Andy From: Li,Qinghong,ST.LOUIS,Molecular Biology Hi, I use write.table() to write a file to an external xls file. the column names left-shift one position in output file. I check with col.names() row.names(), the file is fine. How to prevent the shifting? I71 I111I304I307I305I306I114I72 AFFX-BioB-5_at6.66435 6.7878075.335962 5.250163 6.47423 5.8821045.9651096.591687195 AFFX-BioB-M_at6.1632275.965427 4.665569 2.7435316.0972445.77137 5.113683 6.314003982 Thanks, Johnny [[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] Greek letters in plots
Johanna Hardin wrote: * paste(rho=, cor2[i]) will produce a label of rho=0.74, or whatever. But if I use 'substitute' or 'evaluate' commands in order to get a real Greek letter, I lose the ability to paste it with a data value. Use parse() to turn that text into an expression. And use '==': rho=0.78 plot(1:10,main=parse(text=paste(rho == ,rho))) Not sure where your label is going, but the same thing should work for axes and text labels. Baz __ 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] Greek letters in plots
On Tue, 2005-11-01 at 05:20 -0800, Johanna Hardin wrote: Hi, all. I know that this is probably something that others have asked, but I can't find a reference in either the FAQ or the help pages. I'm trying to find a way to put Greek letters as a label of the plot *with* a value from the data. Previously I've used pasted and the word rho. * paste(rho=, cor2[i]) will produce a label of rho=0.74, or whatever. But if I use 'substitute' or 'evaluate' commands in order to get a real Greek letter, I lose the ability to paste it with a data value. Any ideas? Thanks, Jo Try this: cor2 - 0.74 plot(1:5) title(bquote(rho == .(cor2))) See ?plotmath and ?bquote for more information, noting the use of the .(Variable) syntax for variable substitution. HTH, Marc Schwartz __ 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] R2WinBUGS: Comparison to WinBUGS
Hadassa Brunschwig wrote: Hi R-Users! I know I posted the question before (see archives) but I have not been able to find the mistake. Again using R2WinBUGS and WinBUGS does not yield the same result (although to my opinion the commands are the same). The variance of the parameters is much bigger and the parameter estimates are a bit different, too. If anybody has the time and interest to get the files and data and see if he/she has the same problems, I would be happy to provide these (and to discuss it further). It seems though that it must be my mistake SOMEWHERE because nobody else reported any problems yet... Thanks. Hadassa Please send me your data in a private message. Perhaps we (let me include Sibylle Sturtz here, since she certainly knows better) find some time during the next week to look into it. 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] Greek letters in plots
On Tue, 1 Nov 2005, Marc Schwartz wrote: On Tue, 2005-11-01 at 05:20 -0800, Johanna Hardin wrote: Hi, all. I know that this is probably something that others have asked, but I can't find a reference in either the FAQ or the help pages. FAQ 7.13 and the example in ?plotmath that starts ## How to combine math and numeric variables : -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle __ 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] Greek letters in plots
Marc Schwartz [EMAIL PROTECTED] writes: Try this: cor2 - 0.74 plot(1:5) title(bquote(rho == .(cor2))) See ?plotmath and ?bquote for more information, noting the use of the .(Variable) syntax for variable substitution. Yep, bquote() is nice. Other solutions include substitute(rho == . , list( . = cor2)) which I suppose is pretty much what bquote does internally -- 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
[R] Unexpected result from binary greater than operator
Hi All, I recently encountered results that I did not expect, exhibited by the following code snippet: test - function() { minX - 4.2 min0 - 4.1 sigmaG - 0.1 Diff - minX-min0 print(c(Diff=Diff,sigmaG=sigmaG)) cat(is Diff sigmaG?:, Diff sigmaG,\n) cat(is (4.2 - 4.1) 0.1?:,(4.2 - 4.1) 0.1,\n) cat(is 0.1 0.1?:, 0.10.1,\n) } When I execute the above function I get the following: test() Diff sigmaG 0.10.1 is Diff sigmaG?: TRUE is (4.2 - 4.1) 0.1?: TRUE is 0.1 0.1?: FALSE Can someone please help me understand why R returns TRUE for (4.2 - 4.1) 0.1 ? Thanks so much, Chris I'm running the precompiled R-2.2.0 binary for Windows on WinXP Pro SP1. Sys.getlocale() LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major2 minor2.0 year 2005 month10 day 06 svn rev 35749 language R __ 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] Unexpected result from binary greater than operator
On 11/1/2005 11:15 AM, [EMAIL PROTECTED] wrote: Can someone please help me understand why R returns TRUE for (4.2 - 4.1) 0.1 ? Rounding error. See the FAQ item 7.31 Why doesn't R think these numbers are equal? The only numbers that can be represented exactly in R's numeric type are integers and fractions whose denominator is a power of 2. Other numbers have to be rounded to (typically) 53 binary digits accuracy. As a result, two floating point numbers will not reliably be equal unless they have been computed by the same algorithm, and not always even then. For example R a - sqrt(2) R a * a == 2 [1] FALSE R a * a - 2 [1] 4.440892e-16 The function all.equal() compares two objects using a numeric tolerance of .Machine$double.eps ^ 0.5. If you want much greater accuracy than this you will need to consider error propagation carefully. For more information, see e.g. David Goldberg (1991), “What Every Computer Scientist Should Know About Floating-Point Arithmetic”, ACM Computing Surveys, 23/1, 5–48, also available via http://docs.sun.com/source/806-3568/ncg_goldberg.html 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] Unexpected result from binary greater than operator
[EMAIL PROTECTED] wrote: Hi All, I recently encountered results that I did not expect, exhibited by the following code snippet: test - function() { minX - 4.2 min0 - 4.1 sigmaG - 0.1 Diff - minX-min0 print(c(Diff=Diff,sigmaG=sigmaG)) cat(is Diff sigmaG?:, Diff sigmaG,\n) cat(is (4.2 - 4.1) 0.1?:,(4.2 - 4.1) 0.1,\n) cat(is 0.1 0.1?:, 0.10.1,\n) } When I execute the above function I get the following: test() Diff sigmaG 0.10.1 is Diff sigmaG?: TRUE is (4.2 - 4.1) 0.1?: TRUE is 0.1 0.1?: FALSE Can someone please help me understand why R returns TRUE for (4.2 - 4.1) 0.1 ? Thanks so much, Chris I'm running the precompiled R-2.2.0 binary for Windows on WinXP Pro SP1. Sys.getlocale() LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major2 minor2.0 year 2005 month10 day 06 svn rev 35749 language R Seems like this is coming up about once a week. See FAQ 7.31. http://cran.r-project.org/doc/FAQ/R-FAQ.html Hint: print(4.2 - 4.1, digits = 16) --sundar __ 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] Unexpected result from binary greater than operator
[EMAIL PROTECTED] writes: Hi All, I recently encountered results that I did not expect, exhibited by the following code snippet: test - function() { minX - 4.2 min0 - 4.1 sigmaG - 0.1 Diff - minX-min0 print(c(Diff=Diff,sigmaG=sigmaG)) cat(is Diff sigmaG?:, Diff sigmaG,\n) cat(is (4.2 - 4.1) 0.1?:,(4.2 - 4.1) 0.1,\n) cat(is 0.1 0.1?:, 0.10.1,\n) } When I execute the above function I get the following: test() Diff sigmaG 0.10.1 is Diff sigmaG?: TRUE is (4.2 - 4.1) 0.1?: TRUE is 0.1 0.1?: FALSE Can someone please help me understand why R returns TRUE for (4.2 - 4.1) 0.1 ? Section 7.31 in the FAQ should help: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f -- 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] Unexpected result from binary greater than operator
Hi. Easy. Regardless of OS and R version answer is binary representation of fractions. (4.2-4.1).1 [1] TRUE but (4.3-4.2).1 [1] FALSE print(4.3-4.2, digits=20) [1] 0.099645 You can not expect precise results using not precise computers. Use e.g. round round(4.3-4.2).1 [1] FALSE HTH Petr On 1 Nov 2005 at 9:15, [EMAIL PROTECTED] wrote: To: r-help@stat.math.ethz.ch From: [EMAIL PROTECTED] Date sent: Tue, 1 Nov 2005 09:15:50 -0700 Subject:[R] Unexpected result from binary greater than operator Hi All, I recently encountered results that I did not expect, exhibited by the following code snippet: test - function() { minX - 4.2 min0 - 4.1 sigmaG - 0.1 Diff - minX-min0 print(c(Diff=Diff,sigmaG=sigmaG)) cat(is Diff sigmaG?:, Diff sigmaG,\n) cat(is (4.2 - 4.1) 0.1?:,(4.2 - 4.1) 0.1,\n) cat(is 0.1 0.1?:, 0.10.1,\n) } When I execute the above function I get the following: test() Diff sigmaG 0.10.1 is Diff sigmaG?: TRUE is (4.2 - 4.1) 0.1?: TRUE is 0.1 0.1?: FALSE Can someone please help me understand why R returns TRUE for (4.2 - 4.1) 0.1 ? Thanks so much, Chris I'm running the precompiled R-2.2.0 binary for Windows on WinXP Pro SP1. Sys.getlocale() LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major2 minor2.0 year 2005 month10 day 06 svn rev 35749 language R __ 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] Unexpected result from binary greater than operator
Look at ?all.equal and ?identical as well as searching the archives for those terms. You'll find many an illuminating thread on precision, floating point arithmetic and other wonders. minX - 4.2 min0 - 4.1 sigmaG - 0.1 Diff - minX-min0 all.equal(Diff, sigmaG) identical(Diff, sigmaG) HTH, Andy __ 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] dataframe conversion
The data structures in R are still very puzzling to me. Can anyone tell me how I can easily convert these two dataframes to one single dataframe with two columns (mean and sd) with 7 rows? meanprofile V1 V2 V3 V4 V5 V6 V7 2292.001 2178.620 1654.310 1784.004 1160.052 1142.061 1046.675 sdprofile V1 V2 V3 V4 V5 V6 V7 310.6714 347.2072 197.2464 532.3916 161.2955 227.3634 108.5017 Thanks! Pieter __ 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] dataframe conversion
The data structures in R are still very puzzling to me. Can anyone tell me how I can easily convert these two dataframes to one single dataframe with two columns (mean and sd) with 7 rows? meanprofile V1 V2 V3 V4 V5 V6 V7 2292.001 2178.620 1654.310 1784.004 1160.052 1142.061 1046.675 sdprofile V1 V2 V3 V4 V5 V6 V7 310.6714 347.2072 197.2464 532.3916 161.2955 227.3634 108.5017 There are several ways to go about this. Here's one: t(rbind(meanprofile, sdprofile)) ?rbind and ?t HTH, Andy __ 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] dataframe conversion
Pieter Provoost wrote: The data structures in R are still very puzzling to me. Can anyone tell me how I can easily convert these two dataframes to one single dataframe with two columns (mean and sd) with 7 rows? meanprofile V1 V2 V3 V4 V5 V6 V7 2292.001 2178.620 1654.310 1784.004 1160.052 1142.061 1046.675 sdprofile V1 V2 V3 V4 V5 V6 V7 310.6714 347.2072 197.2464 532.3916 161.2955 227.3634 108.5017 This is quite an unusual task, because you won't have data structure in a data.frame most of the times. In particular, you cannot make a row from a data.frame to a column generally. In this case, we just convert the data.frame to matrix. I think most easily you can write: dat - t(rbind(meanprofile, sdprofile)) colnames(dat) - c(meanprofile, sdprofile) Uwe Ligges Thanks! Pieter __ 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 change label size in a plot
Fiona Mc Cahey wrote: Dear all, I have created a plot like this: matrix-read.table(G:\\my documents\\names.txt,header=T) hc-hclust(dist(matrix)^2,cen) memb-cutree(hc,k=10) plot(hc,col=black) What about specifying argument cex? Uwe Ligges This prints out a dendrogram with labels, but the text of the labels is large, so they overlap and are unreadable. How can I decrease the size of the lable text on a dendrogram so that it does not overlap and is therefore readable? I know the question is similar to that posted by Michael Schmitt on 19 March 2005, but as far as I can see, the question was not answered. Many Thanks, Fiona Fíona Mc Cahey Department of Chemistry University of Cambridge Lensfield Road Cambridge, CB2 1EW __ 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] Build R package with shared library
Marcelo Damasceno wrote: Hello to all, I am try to build a package, I do the follow commands: R CMD check pack, R CMD pack build and run OK, no errors. I put my shared library in package subdirectory R, src, but it is not put a shared library .so in directory /usr/lib/R/library/pack/lib. Below is my code : Hmmm. You have to INSTALL a package. Shared libraries will be build on the fly while installing. Hence I think you have not read the mnauals carefully enough. You can put C and Fortran files in ./src, the shared library will be installed during R CMD INSTALL pack into the ./lib directory. dyn.load(pack.so,PACKAGE=pack) argc-2 argv-c(./test,file1) .C(main,as.integer(argc),as.vector(argv),PACKAGE=pack) You really want to pass a directory and a filename to your shared library? So, why are you using R in between? Uwe Ligges What am I doing wrong? -- Marcelo Damasceno de Melo Graduando em Ciência da Computação Departamento de Tecnologia da Informação - TCI Universidade Federal de Alagoas - UFAL Maceió - Alagoas - Brasil Projeto CoCADa - Construção do Conhecimento por Agrupamento de dados +55 82 8801-2119 [[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] kernel smoothing
Dear all, I want to use kernel estimator to smooth some step funtions such as the empirical distribution and hazard function in survival analysis. Is there a function or package to deal with it in R? How do I use it? Thanks for your help. Jimmy __ 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] glmmpql and lmer keep failing
Hello, I'm running a simulation study of a multilevel model with binary response using the binomial probit link. It is a random intercept and random slope model. GLMMPQL and lmer fail to converge on a *significant* portion of the *generated* datasets, while MlWin gives reasonable estimates on those datasets. This is unacceptable. Does anyone has similar experiences? Regards, Roel de Jong __ 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] dataframe conversion
On 11/1/05, Uwe Ligges [EMAIL PROTECTED] wrote: Pieter Provoost wrote: The data structures in R are still very puzzling to me. Can anyone tell me how I can easily convert these two dataframes to one single dataframe with two columns (mean and sd) with 7 rows? meanprofile V1 V2 V3 V4 V5 V6 V7 2292.001 2178.620 1654.310 1784.004 1160.052 1142.061 1046.675 sdprofile V1 V2 V3 V4 V5 V6 V7 310.6714 347.2072 197.2464 532.3916 161.2955 227.3634 108.5017 This is quite an unusual task, because you won't have data structure in a data.frame most of the times. In particular, you cannot make a row from a data.frame to a column generally. In this case, we just convert the data.frame to matrix. I think most easily you can write: dat - t(rbind(meanprofile, sdprofile)) colnames(dat) - c(meanprofile, sdprofile) Or perhaps: data.frame(meanprofile = unlist(meanprofile), sdprofile = unlist(sdprofile)) __ 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] percent rank by an index key?
What is the easiest way to calculate a percent rank by an index key? Foe example, I have a dataset with 3 fields: Year,State, Income , I wish to calculate the rank, by year, by state. I also wish to calculate the percent rank, where I define percent rank as rank/n. (n is the number of numeric data points within each date-state grouping.) This is what I am currently doing: 1. I create a group by field by using the paste function to combine date and state into a field called date_state. I then use the rank function to calculate the rank by date, by state. 2. I then add a field called one that I set to 1 if the value in income is numeric and to 0 if it is not. 3. I then take an aggregate sum of one. This gives me a count (n) for each date-state grouping. 4. I next use merge to add this count to the table. 5. Finally, I calculate the percent rank. Pr-rank/n The merge takes quite a bit of time to process. Is there an easier/more efficient way to calculate the percent rank? - [[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] kernel smoothing
Please, please read the docs! That's what they're for. RsiteSearch(smoothing) help.search(smoothing) -- 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 Zhu, Chao (UMC-Student) Sent: Tuesday, November 01, 2005 8:57 AM To: r-help@stat.math.ethz.ch Subject: [R] kernel smoothing Dear all, I want to use kernel estimator to smooth some step funtions such as the empirical distribution and hazard function in survival analysis. Is there a function or package to deal with it in R? How do I use it? Thanks for your help. Jimmy __ 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] percent rank by an index key?
t c wrote: What is the easiest way to calculate a percent rank “by” an index key? Foe example, I have a dataset with 3 fields: Year,State, Income , I wish to calculate the rank, by year, by state. I also wish to calculate the “percent rank”, where I define percent rank as rank/n. (n is the number of numeric data points within each date-state grouping.) This is what I am currently doing: 1. I create a “group by” field by using the paste function to combine date and state into a field called date_state. I then use the rank function to calculate the rank by date, by state. 2. I then add a field called “one” that I set to 1 if the value in income is numeric and to 0 if it is not. 3. I then take an aggregate sum of “one”. This gives me a count (n) for each date-state grouping. 4. I next use merge to add this count to the table. 5. Finally, I calculate the percent rank. Pr-rank/n The merge takes quite a bit of time to process. Is there an easier/more efficient way to calculate the percent rank? How about using ?by: set.seed(100) # fake data set, replace with your own # Subject is just a dummy to produce replicates x - expand.grid(Year = 2000:2005, State = c(TX, AL), Subject = 1:10) x$Income - floor(runif(NROW(x)) * 10) r - by(x$Income, x[c(Year, State)], function(x) { r - rank(x) n - length(x) cbind(Rank = r, PRank = r/n) }) x - cbind(x, do.call(rbind, r)) HTH, --sundar __ 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] kernel smoothing
Smoothing CDF or survival functions are not quite the same as usual scatterplot smoothing, at least because of the monotonicity contraint. I don't know of kernel methods for smoothing such functions, but I believe people have used splines. I'm no expert though. It's best for you to consult an expert or search the literature. Andy From: Zhu, Chao (UMC-Student) Dear all, I want to use kernel estimator to smooth some step funtions such as the empirical distribution and hazard function in survival analysis. Is there a function or package to deal with it in R? How do I use it? Thanks for your help. Jimmy __ 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] function effect and standard error
Hi list! I did the following regression: reg1 - glm(alti~sp + ovent + vivent + nuage, family=gaussian, data=meteo1) I was interested in knowing the effect of the species (sp) in reg1 and so I used the function «effect»: effect.sp - effect (sp, reg1, se=TRUE) with this output: sp AK BW NH OS RT SS 2.730101 2.885363 2.753774 2.750311 3.084606 2.834390 If I enter the following command: effect.sp$se I get this output: 1253 3100488514 6100 0.07924610 0.06713200 0.11493178 0.13106639 0.05252749 0.04208334 My question is: Do the numbers on the second line of this output represent the standard error? What do the numbers on the top line represent? Thank you, Emilie Berthiaume graduate student Biology Departement Université de Sherbrooke 2500 boul. de l'Université Sherbrooke, Québec J1K 2R1 CANADA Tél: 1-819-821-8000 poste 2059 Fax: 1-819-821-8049 [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
Re: [R] Doubly Non-Central F-Distribution
Hi Wolfgang. I would be surprised if a doubly noncentral F-distribution function is available (and encourage you to check its accuracy if it is). Although R allows pf() to have a noncentral value specified, the results are not always accurate. I posted about this about a week ago (10/24/05) and didn't hear anything back regarding the accuracy issue. The bug I reported is here (# 8251): http://viggo.kubism.ku.dk/cgi-bin/R/Accuracy?id=8251;user=guest I am very interested in (singularly) noncentral F-distribution functions, so I too would like to learn of a doubly noncentral F-distribution function (since the singularly noncentral F is a special case of the doubly noncentral F; or learn of an alternative or fix to pf() as it now stands). Have a good day, Ken Viechtbauer Wolfgang (STAT) wrote: Hello All, Has anyone written a function for the distribution function of a *doubly* non-central F-distribution? I looked through the archives, but didn't find anything. Thanks! Wolfgang __ 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 -- Ken Kelley, Ph.D. Inquiry Methodology Program Indiana University 201 North Rose Avenue, Room 4004 Bloomington, Indiana 47405 http://www.indiana.edu/~kenkel __ 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] Error on read.table
Hello When trying to read a table from excel, the generated error message is not documented in the R data import document: v2 - read.table(v2-101-405-excel.txt, header=T,row.names=0) Error in read.table(v2-101-405-excel.txt, header = T, row.names = 0) : attempt to select less than one element How do I proceed to resolve this problem? thanks Lars Here are the first three out of around 500 rows in the file (missing data in Target.RESP col is marked as NA): Subject Sex Age Gruppe TypeTarget.CRESPTarget.RESP Target.RT Prime.OnsetTime Target.OnsetTimeOrdning Ident 101 female 22 7 t 0 0 1520155074 158497 101 145 101 female 22 9 o 0 1 3020161678 166005 102 160 __ 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] function effect and standard error
Dear Emilie, This is, I think, the effect() function in the effects() package. By the way, the model that you've fit with glm() is just a linear model, and could also have been fit with lm(). For a model with this simple structure, effect() computes the adjusted means for the factor sp, holding other predictors to their average values. These effects are just fitted values under the model, and the standard errors reported are for the fitted values. For details, see the paper at http://www.jstatsoft.org/counter.php?id=75url=v08/i15/effect-displays-revised.pdf. I hope this helps. John On Tue, 1 Nov 2005 12:55:17 -0500 Emilie Berthiaume [EMAIL PROTECTED] wrote: Hi list! I did the following regression: reg1 - glm(alti~sp + ovent + vivent + nuage, family=gaussian, data=meteo1) I was interested in knowing the effect of the species (sp) in reg1 and so I used the function «effect»: effect.sp - effect (sp, reg1, se=TRUE) with this output: sp AK BW NH OS RT SS 2.730101 2.885363 2.753774 2.750311 3.084606 2.834390 If I enter the following command: effect.sp$se I get this output: 1253 3100488514 6100 0.07924610 0.06713200 0.11493178 0.13106639 0.05252749 0.04208334 My question is: Do the numbers on the second line of this output represent the standard error? What do the numbers on the top line represent? Thank you, Emilie Berthiaume graduate student Biology Departement Université de Sherbrooke 2500 boul. de l'Université Sherbrooke, Québec J1K 2R1 CANADA Tél: 1-819-821-8000 poste 2059 Fax: 1-819-821-8049 [EMAIL PROTECTED] [[alternative HTML version deleted]] John Fox Department of Sociology McMaster University Hamilton, Ontario, Canada http://socserv.mcmaster.ca/jfox/ __ 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] Error on read.table
Hello Lars, from the read.table documentation: row.names: a vector of row names. This can be a vector giving the actual row names, or a single number giving the column of the table which contains the row names, or character string giving the name of the table column containing the row names. Column numbering in R starts at 1 but you tell read.table to use the 0th column - this is consitent with your error message. The folowing works for me: x - read.table(bla, header=T) x SubjectSex Age Gruppe Type Target.CRESP Target.RESP Target.RT 1 101 female 22 7t0 0 1520 2 101 female 22 9o0 1 3020 Prime.OnsetTime Target.OnsetTime Ordning Ident 1 155074 158497 101 145 2 161678 166005 102 160 -Marc -- Dipl. Inform. Med. Marc Kirchner Interdisciplinary Centre for Scientific Computing (IWR) Multidimensional Image Processing INF 368 University of Heidelberg D-69120 Heidelberg Tel: ++49-6221-54 87 97 Fax: ++49-6221-54 88 50 [EMAIL PROTECTED] signature.asc Description: Digital signature __ 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] Problems with dyn.load()
I have a question, Is there some function that returns the directory where the libraries of the instaled package are? Because in Mandrake, R installs in /usr/lib/R/library/pack/libs, and in Debian it installs in /usr/local/lib/R/library/pack /libs. Thanks. -- Marcelo Damasceno de Melo Graduando em Ciência da Computação Departamento de Tecnologia da Informação - TCI Universidade Federal de Alagoas - UFAL Maceió - Alagoas - Brasil Projeto CoCADa - Construção do Conhecimento por Agrupamento de dados +55 82 8801-2119 [[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] index question
Thanks for those on the list that answered my previous question. I'm just about where I need to be (looking at output). In the hier.part documentation there is a line env - urbanwq[,2:8]. This means use rows 2 through 8 in the data frame urbanwq, right? What does the comma represent? If one wasn't using column headers would this be necessary? Thanks, Jeff Jeffrey A. Stratford, Ph.D. Postdoctoral Associate 331 Funchess Hall Department of Biological Sciences Auburn University Auburn, AL 36849 334-329-9198 FAX 334-844-9234 http://www.auburn.edu/~stratja __ 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] Problems with dyn.load()
On Tue, 1 Nov 2005, Marcelo Damasceno wrote: Is there some function that returns the directory where the libraries of the instaled package are? Because in Mandrake, R installs in /usr/lib/R/library/pack/libs, and in Debian it installs in /usr/local/lib/R/library/pack/libs. ?system.file -- SIGSIG -- signature too long (core dumped) __ 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] index question
Jeffrey Stratford wrote: Thanks for those on the list that answered my previous question. I'm just about where I need to be (looking at output). In the hier.part documentation there is a line env - urbanwq[,2:8]. This means use rows 2 through 8 in the data frame urbanwq, right? What does the comma represent? If one wasn't using column headers would this be necessary? Thanks, Jeff Hi, Jeff, Actually it means *columns* 2:8. See the documentation and examples in help([). --sundar /war eagle __ 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 Graphs in Powerpoint
I've tried several methods in OS X, and here's what works best for me. Save the R graphic as a PDF file. Open it with Apple's Preview application, and save it as a PNG file. The resulting .png file can be inserted into MS Word or PowerPoint, can be resized, and looks good on either OS X or Windows. There are other programs available for translating the pdf file to png (like the shareware application Graphic Converter), but I've found that Preview produces the best results. Daniel Smith Environmental Health Investigations Branch California Dept of Health Services -Original Message- Date: Mon, 31 Oct 2005 15:14:06 -0800 From: Jarrett Byrnes [EMAIL PROTECTED] Subject: [R] R Graphs in Powerpoint To: r-help@stat.math.ethz.ch Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=US-ASCII; format=flowed Hey, all. Quick question. I'm attempting to use some of the great graphs generated in R for an upcoming talk that I'm writing in Powerpoint. Copying and pasting (I'm using OSX) yields graphs that look great in Powerpoint - until I resize them. Then fonts, points, and lines all become quite pixelated and blurry. Even if I size the window properly first, and then copy and paste in the graph, when I then view the slideshow, the graphs come out pixelated and blurry. Is there any good solution to this, or is this some fundamental incompatibility that I can't get around? -Jarrett __ 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] RODBC error
Hi, I hope that someone can help me with the following problem with RODBC connection to a MySQL database I am running R version 2.2.0 on windows XP, and have the MySQL database registered in Windows ODBC. I have set up a web interface on my personal ISS web server using PhP to accept input values and then call Rterm with an R script to access the database and return a summary of the analysed data. This works perfectly if I run it from Rgui, or if I run Rterm from the dos prompt using the same command line arguments, but returns an RODBC error (below) when calling Rterm from the web interface 1: [RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified There appears to be some problem with recognising the database when called from the web page, even though it is not a problem at any other times. Does anyone have any suggestions as to what I can do to overcome this error Thanks for your help cheers Evan Sergeant AusVet Animal Health Services 69 Turner Cr, Orange NSW 2800 Australia Phone +61 2 6362 1598 Fax +61 2 6369 1473 Email: [EMAIL PROTECTED] Web site: http://www.ausvet.com.au MLA's Q Fever Register: www.qfever.org This transmission is for the intended addressee only and is confidential information. If you have received this transmission in error, please delete it and notify the sender. The contents of this email are the opinion of the writer only a __ 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] coding nesting in data for nlme example of Wafer data set.
I am trying to understand the proper way to encode the nesting structure for data in the context of nlme, in the specific case of individuals nested within species for which each individual is unique. I have searched through Pinheiro Bates and also past postings, but without success. Take the Wafer data set which has 2 levels: Wafer (8 values) and Site nested within Wafer (10 values for each value of Wafer) (Pinheiro Bates book). The data set has Sites coded as values from 1 to 8 for Wafer 1, values 1 to 8 for Wafer 2 etc. Does this mean that the SAME sites are used for each Wafer (i.e. site 1 of water 1 is the same as site 1 of wafer 2)? If different sites were chosen for each of the wafers would one have to code the sites = 1 to 8 for Wafer 1, sites = 9 to 16 for Wafer 2, and so on? In the case of individuals nested within species, each individual is unique - analogous to different sites being chosen for each wafter. Thanks. Bill Shipley [[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] Area under standard normal density
What is the correct syntax for finding the area under the standard normal density for a particular value of z? Thanks [[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 with hier.part
R-users, Attached is the file (SR_use2.txt) I'd like to include and includes column headers. nat_est is the response variable and is the number of species at a particular point. The other variables are the explanatory vars (vark, var2, var1, UK, U2, U1, GK, G2, G1, PK, P2, P1). Here is Walsh's sample code for hier.part: data(urbanwq) env - urbanwq[,2,8] hier.part(urbanwq$lec, env, fam=gaussian, gof=Rssqu) The code I wrote is library(hier.part) SRUSE- read.table(F:\\GEORGIA\\species_richness\\SR_use2.txt, sep= , header = TRUE, row.names = 1) TEMP- SRUSE[2:13] hier.part(SRUSE$nat_est,TEMP, family=NegBin, gof=logLik, barplot= TRUE) So far this doesn't work and I'd really appreciate some help. While I have your ears, what books would one make for the clueless? Many thanks, Jeff PS. nat_est is the estimated number of species (species richness). Around each of the sampling points I calculated the % of different types of cover (pine, hardwoods, number of different covers) in three scales around the sampling points (1000, 200, and 100 m). What I'm hoping to do with the analysis is to find the best scales and parameters that best predicts species richness. . Jeffrey A. Stratford, Ph.D. Postdoctoral Associate 331 Funchess Hall Department of Biological Sciences Auburn University Auburn, AL 36849 334-329-9198 FAX 334-844-9234 http://www.auburn.edu/~stratja __ 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] Area under standard normal density
YOST Andrew wrote: What is the correct syntax for finding the area under the standard normal density for a particular value of z? Thanks ?qnorm __ 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] Area under standard normal density
Sorry, ?pnorm. --sundar P.S. Thanks to the anonymous correction. Sundar Dorai-Raj wrote: YOST Andrew wrote: What is the correct syntax for finding the area under the standard normal density for a particular value of z? Thanks ?qnorm __ 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] multidimensional integration not over a multidimensional rectangle
Hi, anyone knows about any functions in R can get multidimensional integration not over a multidimensional rectangle (not adapt). For example, I tried the following function f(x,n)=x^n/n! phi.fun-function(x,n) { if (n==1) { x }else{ integrate(phi.fun, lower=0, upper=x, n=n-1)$value } } I could get f(4,2)=4^2/2!=8, but failed in f(4,3)=4^3/3! Thanks Best, Lynette __ 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] glmmpql and lmer keep failing
Formulated more directly, are there plans for the implementation of the crude but more robust Marginal Quasi Likelihood estimation in for example LME? Regards, Roel de Jong Roel de Jong wrote: Hello, I'm running a simulation study of a multilevel model with binary response using the binomial probit link. It is a random intercept and random slope model. GLMMPQL and lmer fail to converge on a *significant* portion of the *generated* datasets, while MlWin gives reasonable estimates on those datasets. This is unacceptable. Does anyone has similar experiences? Regards, Roel de Jong __ 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] two sample Cramer-von Mises test
Hello list, Is there any function in some package can calculate two sample Cramer-von Mises test statistic? I searched around and only find one sample version cvm.test() in nortest package. thanks, WC _ Dont just search. Find. Check out the new MSN Search! __ 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] glmmpql and lmer keep failing
Sorry to be blunt, but to make the statement that it is unacceptable without providing any reason why the model may fail to converge seems a little presumptious. Your statement really bothers me, especially knowing how hard the developer works on keeping this function at a premier level. Ask anyone working with mixed models and they will all agree that Doug Bates and this function are shining stars in the world of computational statistics. R is open source, and therefore you are certainly welcome and encouraged to add to its functionality if you wish. Basically, one may argue that you are in a put up, or shut up position. Feel free to write a nice piece of code based on MQL that we can use (and critique). But even more importantly, in order to provide any help to you at all, you should provide sample data and examples of your code. We may find that the problem is the user and not the function. I generally disagree with rudeness on this list, and agree that my tone is not very agreeable, but please read the posting guide and follow basic protocol by describing your problem, create sample data, illustrate your code, and then ask for help. Harold -Original Message- From: [EMAIL PROTECTED] on behalf of Roel de Jong Sent: Tue 11/1/2005 6:05 PM To: r-help Cc: Subject:Re: [R] glmmpql and lmer keep failing Formulated more directly, are there plans for the implementation of the crude but more robust Marginal Quasi Likelihood estimation in for example LME? Regards, Roel de Jong Roel de Jong wrote: Hello, I'm running a simulation study of a multilevel model with binary response using the binomial probit link. It is a random intercept and random slope model. GLMMPQL and lmer fail to converge on a *significant* portion of the *generated* datasets, while MlWin gives reasonable estimates on those datasets. This is unacceptable. Does anyone has similar experiences? Regards, Roel de Jong __ 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] glmmpql and lmer keep failing
Hi, I believe we could extend our upcoming release of our freely available AD Model Builder negative binomial mixed model http://otter-rsch.com/admbre/admbre.html packaqge for R to include your model. Writing the model is simple, it is the interface with R that is a bit more difficult. If you contact me privately I will take a look at it. Cheers, Dave -- David A. Fournier P.O. Box 2040, Sidney, B.C. V8l 3s3 Canada http://otter-rsch.com -- __ 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] glmmpql and lmer keep failing
The word unacceptable was maybe poorly chosen, but I meant it was unacceptable for my purposes that a lot of samples needed to be discarded. Further, I don't need to give code, data, or other reasons why the model may fail because it is well known that PQL can suffer from convergence problems, and this issue is already well documented in the R help list and articles I skimmed through before posting. So all I wanted to know if how someone else with similar experiences tackled this problem, and if there are plans for the implementation of MQL in lme or another package. As of my own contribution, I will soon release a Gibbs sampler for multilevel models under the binomial probit link that also can handle random slopes. But I'm sorry I bothered you, guardian of the shining multilevel star. Roel. Doran, Harold wrote: Sorry to be blunt, but to make the statement that it is unacceptable without providing any reason why the model may fail to converge seems a little presumptious. Your statement really bothers me, especially knowing how hard the developer works on keeping this function at a premier level. Ask anyone working with mixed models and they will all agree that Doug Bates and this function are shining stars in the world of computational statistics. R is open source, and therefore you are certainly welcome and encouraged to add to its functionality if you wish. Basically, one may argue that you are in a put up, or shut up position. Feel free to write a nice piece of code based on MQL that we can use (and critique). But even more importantly, in order to provide any help to you at all, you should provide sample data and examples of your code. We may find that the problem is the user and not the function. I generally disagree with rudeness on this list, and agree that my tone is not very agreeable, but please read the posting guide and follow basic protocol by describing your problem, create sample data, illustrate your code, and then ask for help. Harold -Original Message- From: [EMAIL PROTECTED] on behalf of Roel de Jong Sent: Tue 11/1/2005 6:05 PM To: r-help Cc: Subject:Re: [R] glmmpql and lmer keep failing Formulated more directly, are there plans for the implementation of the crude but more robust Marginal Quasi Likelihood estimation in for example LME? Regards, Roel de Jong Roel de Jong wrote: Hello, I'm running a simulation study of a multilevel model with binary response using the binomial probit link. It is a random intercept and random slope model. GLMMPQL and lmer fail to converge on a *significant* portion of the *generated* datasets, while MlWin gives reasonable estimates on those datasets. This is unacceptable. Does anyone has similar experiences? Regards, Roel de Jong __ 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 with the coordinates of the ECDF object
Hi all R users I would like to know how acess the coordinates of the ECDF object. I look for the example, in this part: ## print(ls.Fn12 - ls(env= environment(Fn12))) ## but I do not know to extract the Y coordinate and put it in other variable. My objective is to make a plot and identify the points with labels. # Example by ?ecdf y - round(rnorm(12),1); y[3] - y[1] Fn12 - ecdf(y) Fn12 print(knots(Fn12), dig=2) 12*Fn12(knots(Fn12)) ## ~= 1:12 if there were no ties summary(Fn12) summary.stepfun(Fn12) print(ls.Fn12 - ls(env= environment(Fn12))) ##[1] f method n x y yleft yright # Example by ?ecdf My objetive seems to this: plot(Fn12) identify( x = knots(Fn12), y = ??, labels=my string set) or text... thanks in advanced klebyn __ 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] help with the coordinates of the ECDF object
Hi, try environment(Fn12)$y environment(Fn12)$x Nolwenn ** Nolwenn Le Meur, PhD Fred Hutchinson Cancer Research Center Computational Biology 1100 Fairview Ave. N., M2-B876 P.O. Box 19024 Seattle, WA 98109-1024 On Tue, 1 Nov 2005, klebyn wrote: Hi all R users I would like to know how acess the coordinates of the ECDF object. I look for the example, in this part: ## print(ls.Fn12 - ls(env= environment(Fn12))) ## but I do not know to extract the Y coordinate and put it in other variable. My objective is to make a plot and identify the points with labels. # Example by ?ecdf y - round(rnorm(12),1); y[3] - y[1] Fn12 - ecdf(y) Fn12 print(knots(Fn12), dig=2) 12*Fn12(knots(Fn12)) ## ~= 1:12 if there were no ties summary(Fn12) summary.stepfun(Fn12) print(ls.Fn12 - ls(env= environment(Fn12))) ##[1] f method n x y yleft yright # Example by ?ecdf My objetive seems to this: plot(Fn12) identify( x = knots(Fn12), y = ??, labels=my string set) or text... thanks in advanced klebyn __ 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] help with the coordinates of the ECDF object
If you wish to apply labels to identified points: I am sure there is a better way, but what I have done is use locator(n) #n is how many points you wish to identify. Then click on the points. The coordinates of each point are returned. Then I use identify(x, y, labels = My Label) ...for each point identified. It would be great if you could click on the points and have them identified labelled, but I'm not sure how to do it. -Original Message- From: klebyn [mailto:[EMAIL PROTECTED] Sent: Wednesday, 2 November 2005 12:25 PM To: r-help@stat.math.ethz.ch Subject: [R] help with the coordinates of the ECDF object Hi all R users I would like to know how acess the coordinates of the ECDF object. I look for the example, in this part: ## print(ls.Fn12 - ls(env= environment(Fn12))) ## but I do not know to extract the Y coordinate and put it in other variable. My objective is to make a plot and identify the points with labels. # Example by ?ecdf y - round(rnorm(12),1); y[3] - y[1] Fn12 - ecdf(y) Fn12 print(knots(Fn12), dig=2) 12*Fn12(knots(Fn12)) ## ~= 1:12 if there were no ties summary(Fn12) summary.stepfun(Fn12) print(ls.Fn12 - ls(env= environment(Fn12))) ##[1] f method n x y yleft yright # Example by ?ecdf My objetive seems to this: plot(Fn12) identify( x = knots(Fn12), y = ??, labels=my string set) or text... thanks in advanced klebyn __ 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] index question
=== 2005-11-02 05:13:45 您在来信中写道:=== Thanks for those on the list that answered my previous question. I'm just about where I need to be (looking at output). In the hier.part documentation there is a line env - urbanwq[,2:8]. This means use rows 2 through 8 in the data frame urbanwq, right? his means use columns 2 through 8 in the data frame urbanwq What does the comma represent? It means the first argument to function [ is left blank,so makes R knows 2:8 is the second argument to [. If one wasn't using column headers would this be necessary? It still is necessary. Thanks, Jeff Jeffrey A. Stratford, Ph.D. Postdoctoral Associate 331 Funchess Hall Department of Biological Sciences Auburn University Auburn, AL 36849 334-329-9198 FAX 334-844-9234 http://www.auburn.edu/~stratja __ 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 = = = = = = = = = = = = = = = = = = = = 2005-11-02 -- Deparment of Sociology Fudan University My new mail addres is [EMAIL PROTECTED] Blog:http://sociology.yculblog.com __ 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] Tcl/tk
Hello, I recently installed the R (the most recent) and Bioconductor on my computer. I installed the packages in affy, the affyGui and the limmaGui on my computer and they all appear in the Load Package window. After trying to load the affyGui or the limmaGui packages I receive the following message entitled: Tcl/Tk Extension(s) Not Found- limmaGUI requires the Tcl/Tk extensions, BWidget and Tktable. You must have Tcl/Tk installed on your computer, not just the minimal Tcl/Tk installation which comes with R (for Windows). If you do have Tcl/Tk installed, including the extensions (e.g. using the ActiveTcl distribution in Windows), make sure that R can find the path to the Tcl library, e.g. C:\Tcl\lib (on Windows) or /usr/lib (on Linux/Unix) or /sw/lib on Mac OSX. Any suggestions. Also I am trying to get the R.app installed and run on my mac, and am not successful. Thanks for your help Sokol [[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] NLME
Dear All, Using:- R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 and Jose Pinheiro, Douglas Bates, Saikat DebRoy and Deepayan Sarkar (2005). nlme: Linear and nonlinear mixed effects models. R package version 3.1-65. on a WINDOWS 2000 machine I am trying to run the scripts from the Mixed Models book and am running into some difficulty - could any one tell me why this doesn't work (from pages 369 - 370) CO2 #FINE plot(CO2,outer= ~Treatment*Type,layout=c(4,1)) #FINE fm1CO2.lis - nlsList( SSasympOff, CO2 ) #FINE fm1CO2.lis #FINE fm1CO2.nlme - nlme( fm1CO2.lis ) #COPIED DIRECTLY FROM BOOK!!?? Gives the error message:- Error in nlme.formula(model = uptake ~ SSasympOff(conc, Asym, lrc, c0), : Maximum number of iterations reached without convergence Any assistance would be greatly appreciated Guy Forrester Guy J Forrester Biometrician Manaaki Whenua - Landcare Research PO Box 69, Lincoln, New Zealand. Tel. +64 3 325 6701 x3738 Fax +64 3 325 2418 E-mail [EMAIL PROTECTED] www.LandcareResearch.co.nz WARNING: This email and any attachments may be confidential ...{{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