Re: [R] Math expressions in pie chart labels?
Johannes Graumann wrote: ronggui wrote: I think you should use labels = c(= 0.66, = 0.33, = -0.33, = -0.66) . Note the quote in each element of the vector. No. Am using that at the moment. Does not give me the nice plotmath 'greater-than' etc. signs ... Then please read ?plotmath and use it: labels = expression( = 0.66, == 0.33, = -0.33, = -0.66) Uwe Ligges Joh __ 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] cannot use fanny in package cluster
Guan-Hua Huang wrote: Dear All, My R version: 2.0.1 ; OS using: Linux. I install the package cluster by using install.packages(cluster). After install it, it runs fine for function clara, but it does not work for function fanny. I did the following things: library(cluster) set.seed(21) x - rbind(cbind(rnorm(10, 0, 0.5), rnorm(10, 0, 0.5)),cbind(rnorm(15, 5, 0.5), rnorm(15, 5, 0.5)),cbind(rnorm( 3,3.2,0.5), rnorm( 3,3.2,0.5))) .proctime00 - proc.time() (fannyx - fanny(x, 2)) and got the following messages: Error in .Fortran(fanny, as.integer(n), as.integer(jp), k, x2, dis = dv, ; Fortran function name not in DLL for package cluster Probably the package maintainer forgot to add the dependency on a more recent R version to the package's DESCRIPTION. Much more relevant: You forgot to upgrade your outdated version of R - we have R-2.3.0 these days! Uwe Ligges Any help. Guan-Hua __ 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] Repeating tdt function on thousands of variables
Farrel Buchinsky wrote: I am using dgc.genetics to perform TDT analysis on SNP data from a cohort of trios. I now have a file with about 6008 variables. The first few variables related to the pedigree data such as the pedigree ID the person ID etc. Thereafter each variable is a specific locus or marker. The variables are named by a pattern such as Genotype.n with n corresponding to a number which is the name or id of the locus. I am able to get the tdt to run by each locus. tdt(Genotype.914186, PGWide, famid, pid, fatid, motid, sex, affected ) Looks like you have to be much more specific: R tdt(Genotype.914186, PGWide, famid, pid, fatid, motid, sex, affected) Error: could not find function tdt Uwe Ligges Clearly I cannot type each locus in one at a time. Instead I want to loop it but am not sure how to do it. I tried lapply but it did not really work. The example in Dalgaard's book, sapply( thuesen, mean, na. rm= T) seems to work with basic functions but not with something like tdt. So how does one tell R to calculate the tdt for each variable and output the result to a dataframe in which one of the columns is the locus ID.? Since I have another table in which every locus ID is in one column and in another column I have its chromosome number and exact position on the chromosome I could always create a vector out of the locusIDs but still I would need to know how to pass it on to the tdt function in 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] how to compute the explained variance?
mingyu shi wrote: Hello, I have an ordinary linear regression model. for example y~x1+x2+x3; I need to compute the percentage of variance explained by each covariate. can anyone tell me how I can compute it in R? Please try to solve your homework yourself or by reading a good textbook - or even your teachers notes on the subject. Uwe Ligges thanks so much, ms - [[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] Math expressions in pie chart labels?
Then please read ?plotmath and use it: labels = expression( = 0.66, == 0.33, = -0.33, = -0.66) pie(1:3,lab=) text(locator(3),lab=expression(=1,=2,=3)) Error: attempt to use zero-length variable name text(locator(3),lab=expression(NULL=1,NULL=2,NULL=3)) What 's the problem come from? It seems that NULL=something is prefered to =something,isn't it? version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 3.0 year 2006 month 04 day24 svn rev37909 language R version.string Version 2.3.0 (2006-04-24) __ 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 -- 黄荣贵 Deparment of Sociology Fudan University __ 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 use a validation set rather than the default cross-validation in rpart() ?
Quin Wills wrote: I want use a validation set for my classification tree rather than the default 10-fold validation in rpart() but can't see which arguments to use to get this right. Advice appreciated thanks. I assume that this is possible! You cannot for the internal algorithm that optimizes the splits of the tree. Of course you can do so for estimating the misclassification rate (or whatever), but this has nothing to do with rpart() itself 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] Math expressions in pie chart labels?
ronggui wrote: Then please read ?plotmath and use it: labels = expression( = 0.66, == 0.33, = -0.33, = -0.66) pie(1:3,lab=) text(locator(3),lab=expression(=1,=2,=3)) Error: attempt to use zero-length variable name text(locator(3),lab=expression(NULL=1,NULL=2,NULL=3)) What 's the problem come from? You are using =2 which is not syntactically correct (you cannot assign the number 2 into a variable without any name), you should rather use ==2 (as documented in ?plotmath). Uwe Ligges It seems that NULL=something is prefered to =something,isn't it? version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 3.0 year 2006 month 04 day24 svn rev37909 language R version.string Version 2.3.0 (2006-04-24) __ 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 -- 黄荣贵 Deparment of Sociology Fudan University __ 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] summary.lme: argument adjustSigma
Dear Spencer Thank you for your answer. You are correct. The adjustSigma argument is only used for the ML method. In the code there is: stdFixed - sqrt(diag(as.matrix(object$varFix))) if (object$method == ML adjustSigma == TRUE) { stdFixed - sqrt(object$dims$N/(object$dims$N - length(stdFixed))) * stdFixed } But my question is still open: Looking into the code above, stdFixed is adapted for the ML method if adjustSigma is TRUE. Therefore the standard error and the test results for the fixed effects is affected. But I would expect that the residual standard error should be adapted, too. But object$sigma of the lme object is unchanged and therefore in the summary output, the estimate of the residual standard error is identical, independent of the value of adjustSigma. To my understanding this is a discrepancy to the help page that says: adjustSigma: an optional logical value. If 'TRUE' and the estimation method used to obtain 'object' was maximum likelihood, the residual standard error is multiplied by sqrt(nobs/(nobs - npar)), converting it to a REML-like estimate. This argument is only used when a single fitted object is passed to the function. Default is 'TRUE'. Regards, Christoph Buser -- Christoph Buser [EMAIL PROTECTED] Seminar fuer Statistik, LEO C13 ETH Zurich 8092 Zurich SWITZERLAND phone: x-41-44-632-4673 fax: 632-1228 http://stat.ethz.ch/~buser/ -- Spencer Graves writes: It appears that the adjustSigma argument of 'summary.lme' does nothing with the default method, REML. To check, I tried the following modification of the 'summary.lme' example: fm1 - lme(distance ~ age, Orthodont, random = ~ age | Subject) fm1sa - summary(fm1) fm1s - summary(fm1, adjustSigma=FALSE) fm1saa - summary(fm1, adjustSigma=TRUE) all.equal(fm1s, fm1sa) TRUE all.equal(fm1s, fm1saa) TRUE # When I changed 'method' to ML in this example, the result suggested that the adjustment to sigma also affected the standard errors and t values for the fixed effects. If the p-values had not been 0, they also would have been affected: fm2 - lme(distance ~ age, Orthodont, random = ~ age | Subject, method=ML) (fm2sa - summary(fm2)) Linear mixed-effects model fit by maximum likelihood Data: Orthodont AIC BIClogLik 451.2116 467.3044 -219.6058 Random effects: Formula: ~age | Subject Structure: General positive-definite, Log-Cholesky parametrization StdDevCorr (Intercept) 2.1940998 (Intr) age 0.2149245 -0.581 Residual1.3100399 Fixed effects: distance ~ age Value Std.Error DF t-value p-value (Intercept) 16.76 0.7678975 80 21.827277 0 age 0.660185 0.0705779 80 9.353997 0 Correlation: (Intr) age -0.848 Standardized Within-Group Residuals: Min Q1 Med Q3 Max -3.305969237 -0.487429631 0.007597973 0.482237063 3.922789795 Number of Observations: 108 Number of Groups: 27 (fm2s - summary(fm2, adjustSigma=FALSE)) Linear mixed-effects model fit by maximum likelihood Data: Orthodont AIC BIClogLik 451.2116 467.3044 -219.6058 Random effects: Formula: ~age | Subject Structure: General positive-definite, Log-Cholesky parametrization StdDevCorr (Intercept) 2.1940998 (Intr) age 0.2149245 -0.581 Residual1.3100399 Fixed effects: distance ~ age Value Std.Error DF t-value p-value (Intercept) 16.76 0.7607541 80 22.03223 0 age 0.660185 0.0699213 80 9.44183 0 Correlation: (Intr) age -0.848 Standardized Within-Group Residuals: Min Q1 Med Q3 Max -3.305969237 -0.487429631 0.007597973 0.482237063 3.922789795 Number of Observations: 108 Number of Groups: 27 Does this answer the question? spencer graves Christoph Buser wrote: Dear R-list I have a question concerning the argument adjustSigma in the function lme of the package nlme. The help page says: the residual standard error is multiplied by sqrt(nobs/(nobs - npar)), converting it to a REML-like estimate. Having a look into the code I found: stdFixed - sqrt(diag(as.matrix(object$varFix))) if (object$method == ML adjustSigma == TRUE) { stdFixed - sqrt(object$dims$N/(object$dims$N - length(stdFixed))) * stdFixed } tTable - data.frame(fixed, stdFixed, object$fixDF[[X]], fixed/stdFixed, fixed) To my understanding, only the standard error for the
[R] Problem in using confint method on polr model object
I fit a proportional odds model with the polr-function of the MASS package from Venables and Ripley Applying the confint method to calculate confidence intervals for the parameters I get the following error message Waiting for profiling to be done... Re-fitting to get Hessian Error in X[, -i, drop = FALSE] : incorrect number of dimensions Can someone explain the error-message? (The data are from McCullagh (1980), JRSS,B) tonsiles-data.frame(carrier=factor(rep(c('yes','no'),each=3)), size=ordered(rep(c(1,2,3),2)), count=c(19,29,24,497,560,269)) library(MASS) m-polr(size~carrier,data=tonsiles,weights=count) confint(m) Ulrich platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 3.0 year 2006 month 04 day24 svn rev37909 language R version.string Version 2.3.0 (2006-04-24) Ulrich Halekoh Danish Institute of Agricultural Sciences Unit of Statistics and Decision Analysis Denmark [[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] compile R on Solaris 9
On Tue, 2 May 2006, Brian O'Gorman wrote: I can't make R on a Solaris 9 box. Does anyone have any suggestions? Thanks in advance. Looks like the effect of some header you are including from Solaris9. Try adding #undef open near the top of src/main/connections.c, after fcntl.h is included. Looking at Solaris 8 headers, there is in fcntl.h /* large file compilation environment setup */ #if !defined(_LP64) _FILE_OFFSET_BITS == 64 #ifdef __PRAGMA_REDEFINE_EXTNAME #pragma redefine_extnameopenopen64 #pragma redefine_extnamecreat creat64 #else #define openopen64 #define creat creat64 #endif #endif /* !_LP64 _FILE_OFFSET_BITS == 64 */ so this will probably be avoided if you configure with --disable-largefile However, it is not being reported on other Solaris setups. 3- make `Makedeps' is up to date. `libbz2.a' is up to date. `Makedeps' is up to date. `libpcre.a' is up to date. `Makedeps' is up to date. `libz.a' is up to date. ../../../src/include/libintl.h is unchanged ../../../include/libintl.h is unchanged `localecharset.h' is up to date. `Makedeps' is up to date. `libintl.a' is up to date. `Makedeps' is up to date. `libappl.a' is up to date. `Makedeps' is up to date. `libnmath.a' is up to date. `Makedeps' is up to date. `libunix.a' is up to date. `Makedeps' is up to date. gcc -I../../src/extra/zlib -I../../src/extra/bzip2 -I../../src/extra/pcre -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c connections.c -o connections.o connections.c: In function `init_con': connections.c:381: structure has no member named `open64' connections.c: In function `newfile': connections.c:639: structure has no member named `open64' connections.c: In function `newfifo': connections.c:785: structure has no member named `open64' connections.c: In function `do_fifo': connections.c:837: structure has no member named `open64' connections.c: In function `newpipe': connections.c:919: structure has no member named `open64' connections.c: In function `do_pipe': connections.c:978: structure has no member named `open64' connections.c: In function `newgzfile': connections.c:1114: structure has no member named `open64' connections.c: In function `do_gzfile': connections.c:1163: structure has no member named `open64' connections.c: In function `newbzfile': connections.c:1295: structure has no member named `open64' connections.c: In function `do_bzfile': connections.c:1341: structure has no member named `open64' connections.c: In function `newclp': connections.c:1582: structure has no member named `open64' connections.c: In function `newtext': connections.c:1818: structure has no member named `open64' connections.c: In function `newouttext': connections.c:1974: structure has no member named `open64' connections.c: In function `do_sockconn': connections.c:2094: structure has no member named `open64' connections.c: In function `do_unz': connections.c:2145: structure has no member named `open64' connections.c: In function `do_open': connections.c:2192: structure has no member named `open64' connections.c: In function `do_readLines': connections.c:2462: structure has no member named `open64' connections.c: In function `do_writelines': connections.c:2556: structure has no member named `open64' connections.c: In function `do_readbin': connections.c:2692: structure has no member named `open64' connections.c: In function `do_writebin': connections.c:2895: structure has no member named `open64' connections.c: In function `do_readchar': connections.c:3140: structure has no member named `open64' connections.c: In function `do_writechar': connections.c:3212: structure has no member named `open64' connections.c: In function `switch_or_tee_stdout': connections.c:3390: structure has no member named `open64' connections.c: In function `do_url': connections.c:3622: structure has no member named `open64' connections.c: In function `gzcon_open': connections.c:3673: structure has no member named `open64' connections.c: In function `do_gzcon': connections.c:3969: structure has no member named `open64' connections.c:3987: structure has no member named `open64' *** Error code 1 make: Fatal error: Command failed for target `connections.o' Current working directory /apps/R/R-patched/src/main *** Error code 1 make: Fatal error: Command failed for target `R' Current working directory /apps/R/R-patched/src/main *** Error code 1 make: Fatal error: Command failed for target `R' Current working directory /apps/R/R-patched/src *** Error code 1 make: Fatal error: Command failed for target `R' -- 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, UK
Re: [R] How to use a validation set rather than the default cross-validation in rpart() ?
Many thanks. I'm using it for pruning and was hoping that rpart allows use of a validation set rather than cross-validation for generating a CP/error table. -Original Message- From: Uwe Ligges [mailto:[EMAIL PROTECTED] Sent: 03 May 2006 07:53 To: Quin Wills Cc: r-help@stat.math.ethz.ch Subject: Re: [R] How to use a validation set rather than the default cross-validation in rpart() ? Quin Wills wrote: I want use a validation set for my classification tree rather than the default 10-fold validation in rpart() but can't see which arguments to use to get this right. Advice appreciated thanks. I assume that this is possible! You cannot for the internal algorithm that optimizes the splits of the tree. Of course you can do so for estimating the misclassification rate (or whatever), but this has nothing to do with rpart() itself 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] urppTest Z-tau? Z-alpha?
Hello Anne, you will find the necessary details in the following paper, its publication in 'Biometrika' is cited in ?ur.pp. http://cowles.econ.yale.edu/P/cp/p07a/p0706.pdf Best, Bernhard Hello, Could someone give me a hint about what might be the difference between running urppTest with Z-alpha and Z-tau in type=c(Z-alpha, Z-tau)? Is this the underlying equation: delta_y(t) = mu + tau*timetrend+(1-rho)*y(t-1) + alpha_1*delta_y(t-1) + ... + alpha_k*delta_y(t-k) + error term ? I looked at Banerjee et al. mentioned in the fSeries documentation, but that didn't help. Thanks a lot, Katrin __ 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 mess...{{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
[R] Time series plot
Dear Jiang, We do a lot of plots of that sort. At first I read the time values with as.Date(timevariable, format = %d/%m/%Y). Then You can plot along like Plot(as.Date-variable, your target variable, type = l) If You set axes = F than you can customize the xAxis with axis(1, ...) The AT and LABELS options in axis I fill with something like: at.x - seq(as.Date(2006-01-01), as.Date(2006-05-30), month) lab.x - paste(format(at.x, %b), c(rep('06, 5))) So only the month will appear as labels and tickmarks... HTH Dubravko YOU WROTE: [R] Time series plot Jiang, Jincai \(Institutional Securities Management\) Tue, 02 May 2006 15:28:13 -0700 I have some time series data like 01/02/1990 0.531 0.479 01/03/1990 0.510 0.522 01/06/1990 0.602 0.604 there is no weekends and holidays. how do I graph them in a single plot that the x-axis is the dates and the y-axis is the time series? Thank you Regards, Dubravko Dolic Head of eConsulting Tel: +49 (0)89-55 27 44 - 4630 Fax: +49 (0)89-55 27 44 - 2463 Email: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- Komdat GmbH Nymphenburger Straße 86 80636 München www.komdat.com http://www.komdat.com/ -- ONLINE MARKETING THAT WORKS -- This electronic message contains information from Komdat Gmb...{{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
[R] demo() output looks garbled in default pager (less and most)
Dear Rexperts, I have recently build R-2.3.0 from source on a Linux system and have encountered the following problem (perhaps not exactly a problem, but a minor display flaw): demo() +here is how the output looks in less+ Demos in package E28098baseE28099: is.things Explore some properties of R objects and is.FOO() functions. Not for newbies! recursion Using recursion for adaptive integration scoping An illustration of lexical scoping. Demos in package E28098graphicsE28099: Hershey Tables of the characters in the Hershey vector fonts JapaneseTables of the Japanese characters in the Hershey vector fonts graphicsA show of some of R's graphics capabilities image The image-like graphics builtins of R persp Extended persp() examples plotmathExamples of the use of mathematics annotation Demos in package E28098statsE28099: glm.vr Some glm() examples from VR with several predictors lm.glm Some linear and generalized linear modelling further output clipped ++ +--here how it looks in most-+ 0x: 44656D6F 7320696E 20706163 6B616765 Demos in package 0x0010: 20E28098 62617365 E280993A 0A0A6973 �..base�..:..is 0x0020: 2E746869 6E677320 20202020 20202020 .things 0x0030: 20202020 20204578 706C6F72 6520736F Explore so 0x0040: 6D652070 726F7065 72746965 73206F66 me properties of 0x0050: 2052206F 626A6563 74732061 6E640A20 R objects and. 0x0060: 20202020 20202020 20202020 20202020 0x0070: 20202020 20202069 732E464F 4F282920is.FOO() 0x0080: 66756E63 74696F6E 732E204E 6F742066 functions. Not f 0x0090: 6F72206E 65776269 6573210A 72656375 or newbies!.recu 0x00A0: 7273696F 6E202020 20202020 20202020 rsion 0x00B0: 20202020 5573696E 67207265 63757273 Using recurs 0x00C0: 696F6E20 666F7220 61646170 74697665 ion for adaptive 0x00D0: 20696E74 65677261 74696F6E 0A73636F integration.sco 0x00E0: 70696E67 20202020 20202020 20202020 ping 0x00F0: 20202020 20416E20 696C6C75 73747261 An illustra 0x0100: 74696F6E 206F6620 6C657869 63616C20 tion of lexical 0x0110: 73636F70 696E672E 0A0A4465 6D6F7320 scoping...Demos 0x0120: 696E2070 61636B61 676520E2 80986772 in package �..gr 0x0130: 61706869 6373E280 993A0A0A 48657273 aphics�..:..Hers 0x0140: 68657920 20202020 20202020 20202020 hey 0x0150: 20202020 5461626C 6573206F 66207468 Tables of th -- MOST: *stdin*(1,1) 0% Press `Q' to quit, `H' for help, and SPACE to scroll. ++ The other pageable output tried so far (e.g. library() or ?demo) appears OK in either less and in most. I wonder if I should file a bug about this issue or to seek the solution in a local system misconfiguration. Thank you for any helpful input! Regards, Ivailo -- Ignorance more frequently begets confidence than does knowledge... -- Charles Darwin __ 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] Breaking a matrix into parts
Hi, I've a matrix in 20*11 order. There are 11 variables, i.e 11 columns and each variable have 20 row data. Now i want to calculate covariance between any variable with others taking 4 rows at a time, so that there will be 5 blocks. How can i do this using any R-function? If i want to do it in any 'loop' function? Thanks a lot, SB. __ 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] Breaking a matrix into parts
lapply(split(mat, gl(nrow(mat)/4, 4, nrow(mat)), cov) --- Jacques VESLOT CNRS UMR 8090 I.B.L (2ème étage) 1 rue du Professeur Calmette B.P. 245 59019 Lille Cedex Tel : 33 (0)3.20.87.10.44 Fax : 33 (0)3.20.87.10.31 http://www-good.ibl.fr --- SUMANTA BASAK a écrit : Hi, I've a matrix in 20*11 order. There are 11 variables, i.e 11 columns and each variable have 20 row data. Now i want to calculate covariance between any variable with others taking 4 rows at a time, so that there will be 5 blocks. How can i do this using any R-function? If i want to do it in any 'loop' function? Thanks a lot, SB. __ 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 use a validation set rather than the default cross-validation in rpart() ?
On Wed, 3 May 2006, Quin Wills wrote: Many thanks. I'm using it for pruning and was hoping that rpart allows use of a validation set rather than cross-validation for generating a CP/error table. Since it is not documented how to, why do you expect to? Indeed, why do you think it would be a good idea? -Original Message- From: Uwe Ligges [mailto:[EMAIL PROTECTED] Sent: 03 May 2006 07:53 To: Quin Wills Cc: r-help@stat.math.ethz.ch Subject: Re: [R] How to use a validation set rather than the default cross-validation in rpart() ? Quin Wills wrote: I want use a validation set for my classification tree rather than the default 10-fold validation in rpart() but can't see which arguments to use to get this right. Advice appreciated thanks. I assume that this is possible! You cannot for the internal algorithm that optimizes the splits of the tree. Of course you can do so for estimating the misclassification rate (or whatever), but this has nothing to do with rpart() itself 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 -- 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] demo() output looks garbled in default pager (less and most)
You are almost certainly using a UTF-8 locale and have the character set for less and/or your terminal set incorrectly. This works exactly as intended on a properly configured Linux system in single-byte and UTF-8 locales. This would be quite inappropriate as a bug report on R. On Wed, 3 May 2006, Ivailo Stoyanov wrote: Dear Rexperts, I have recently build R-2.3.0 from source on a Linux system and have encountered the following problem (perhaps not exactly a problem, but a minor display flaw): demo() +here is how the output looks in less+ Demos in package E28098baseE28099: Those are UTF-8 byte sequences for left- and right- single quotes. [...] -- 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] How to use a validation set rather than the default cross-validation in rpart() ?
Is it not true that cross-validation can sometimes over estimate classification error - versus bringing in an external validation data set and checking its classification error? I was trying to test this out, but from what I see either way seems to be much of muchness. -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: 03 May 2006 10:33 To: Quin Wills Cc: 'Uwe Ligges'; r-help@stat.math.ethz.ch Subject: Re: [R] How to use a validation set rather than the default cross-validation in rpart() ? On Wed, 3 May 2006, Quin Wills wrote: Many thanks. I'm using it for pruning and was hoping that rpart allows use of a validation set rather than cross-validation for generating a CP/error table. Since it is not documented how to, why do you expect to? Indeed, why do you think it would be a good idea? -Original Message- From: Uwe Ligges [mailto:[EMAIL PROTECTED] Sent: 03 May 2006 07:53 To: Quin Wills Cc: r-help@stat.math.ethz.ch Subject: Re: [R] How to use a validation set rather than the default cross-validation in rpart() ? Quin Wills wrote: I want use a validation set for my classification tree rather than the default 10-fold validation in rpart() but can't see which arguments to use to get this right. Advice appreciated thanks. I assume that this is possible! You cannot for the internal algorithm that optimizes the splits of the tree. Of course you can do so for estimating the misclassification rate (or whatever), but this has nothing to do with rpart() itself 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 -- 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] Giving Error
I tried your code, but it's giving the following error.. Error in match.fun(FUN) : argument FUN is missing, with no default __ 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 fit GJR-GARCH model in R
Hi,All, I am trying to fit a GJR-GARCH model in R: r_t = mu + e_t h_t = alp_0 + alp_1 * e_(t-1)^2 + alp_2 * s_(t-1) * e_(t-1)^2 + beta * h_(t-1) where r_t = return (on day t), h_t = conditional volatility on day t, and s_(t-1) = 1 if e_(t-1) 0 (zero otherwise). I have downloaded the packages tseries and fSeries but can not see how to fit this model. Any help would be very much appreciated. Thanks, Steven _ 享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.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] Giving Error
sorry (need a data.frame) : lapply(split(as.data.frame(mat), gl(nrow(mat)/4, 4, nrow(mat))), cov) --- Jacques VESLOT CNRS UMR 8090 I.B.L (2ème étage) 1 rue du Professeur Calmette B.P. 245 59019 Lille Cedex Tel : 33 (0)3.20.87.10.44 Fax : 33 (0)3.20.87.10.31 http://www-good.ibl.fr --- SUMANTA BASAK a écrit : I tried your code, but it's giving the following error.. Error in match.fun(FUN) : argument FUN is missing, with no default __ Yahoo! India Answers: Share what you know. Learn something new. http://in.answers.yahoo.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] Correlation matrix
Dear R users, Suppose I have a 4*5 data frame like this: Date x1 x2 x3 x4 1/1/2004100 22 12 34 2/1/200433-22 33 12 3/1/20041212 -115 4/1/20041 223 22 1 Now I want to get a correlation matrix for this dataset excluding column-1 and column-3 i.e. I want to get a correlation matrix for variables x1, x3, x4. I know that if this dataframe has only three columns containing x1, x3 and x4 instead of five columns then I can use cor function. If anyone give me any code for doing this I will be very grateful Thanks, Arun [[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] vim R plugin for Linux/Unix
Dear R users, For those of you who like to use the vim editor on a Unix platform, I put together a little homepage for my vim plugin which is also known as vim script No. 1048, featuring a screenshot: http://www.uft.uni-bremen.de/chemie/ranke/index.php?page=vim_R_linux Have a good day! Johannes Ranke -- Dr. Johannes Ranke [EMAIL PROTECTED] UFT Bremen, Leobenerstr. 1 +49 421 218 8971 D-28359 Bremen http://www.uft.uni-bremen.de/chemie/ranke __ 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] Repeating tdt function on thousands of variables
On 5/3/06, Uwe Ligges [EMAIL PROTECTED] wrote: Looks like you have to be much more specific: tdt() is a function within dgc.genetics. dgc.genetics is a package written by David Clayton and available at http://www-gene.cimr.cam.ac.uk/clayton/software/ It consists of extensions to the genetics package. I could always drop the text from the output of help(tdt) here. Would that be acceptable ettiquete? On the one hand my question is highly specific but on the other it quite general...How does one pass a whole batch of variable names to a function that is not one of R base functions such as mean)? __ 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] Correlation matrix
Arun Kumar Saha wrote: Dear R users, Suppose I have a 4*5 data frame like this: Date x1 x2 x3 x4 1/1/2004100 22 12 34 2/1/200433-22 33 12 3/1/20041212 -115 4/1/20041 223 22 1 Now I want to get a correlation matrix for this dataset excluding column-1 and column-3 i.e. I want to get a correlation matrix for variables x1, x3, x4. I know that if this dataframe has only three columns containing x1, x3 and x4 instead of five columns then I can use cor function. If anyone give me any code for doing this I will be very grateful cor(dat[,-c(1,3)] Uwe Ligges Thanks, Arun [[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] survival analysis with right and left censoring and time-dependent covariates
Hi R-users, I have a data set with a particular type of interval-censored data: right and left censored data, but no other type of interval censoring. I need to fit a model with covariates to evaluate the influence of them on the survival time. First: I use Surv of library(survival) to create my survival object. I have two possibilities: Surv(c(1,1,NA,3),c(1,NA,2,3),type=interval2) # 1 1+ 2- 3 , I do not [a,b] in any case. Surv(c(1,1,2,3),c(1,2,2,3),c(1,0,2,1),type=interval) 1 1+ 2- 3 Second:Given that coxph is not valid for interval-censored type of data, I use survreg with covariates. survreg(Surv(c(1,1,NA,3),c(1,NA,2,3),type=interval2) ~covariate) Third: Now I need to fit a model with time-dependent covariates, but I only find examples of how to include time-dependent covariates when using coxph without left censoring (data=Rossi.txt, Jhon Fox), and therfore the event in Surv is 0 until the event occurrs: http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-cox-regression.pdf My question is: How could I fit a survival model that include right-left censoring and time-dependent covariates? Thanks a lot in advance, Berta. __ 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] Repeating tdt function on thousands of variables
Farrel Buchinsky wrote: On 5/3/06, Uwe Ligges [EMAIL PROTECTED] wrote: Looks like you have to be much more specific: tdt() is a function within dgc.genetics. dgc.genetics is a package written by David Clayton and available at http://www-gene.cimr.cam.ac.uk/clayton/software/ It consists of extensions to the genetics package. I could always drop the text from the output of help(tdt) here. Would that be acceptable ettiquete? On the one hand my question is highly specific but on the other it quite general...How does one pass a whole batch of variable names to a function that is not one of R base functions such as mean)? The same way. lapply() and sapply() should work for almost all functions given, if nothing strange happens with environemnts, which is the case here: The problem is tdt() itself. Note that it has its argument data set to sys.frame(sys.parent()) as the default, but l/sapply are evaluating in a different environment! So it was really required to tell us where you got the function from. 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] demo() output looks garbled in default pager (less and most)
Prof Brian Ripley wrote: You are almost certainly using a UTF-8 locale and have the character set for less and/or your terminal set incorrectly. This works exactly as intended on a properly configured Linux system in single-byte and UTF-8 locales. Thank you very much for the hint! I'll be going into configuring the pagers to use UTF-8 correctly. Cheers, Ivailo -- Ignorance more frequently begets confidence than does knowledge... -- Charles Darwin __ 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] Problem in using confint method on polr model object
On Wed, 3 May 2006, Ulrich Halekoh wrote: I fit a proportional odds model with the polr-function of the MASS package from Venables and Ripley Applying the confint method to calculate confidence intervals for the parameters I get the following error message Waiting for profiling to be done... Re-fitting to get Hessian Error in X[, -i, drop = FALSE] : incorrect number of dimensions Can someone explain the error-message? This is a single-coefficient model, and in profile.polr it needs to be X - model.matrix(fitted)[, -1, drop = FALSE] (The data are from McCullagh (1980), JRSS,B) tonsiles-data.frame(carrier=factor(rep(c('yes','no'),each=3)), size=ordered(rep(c(1,2,3),2)), count=c(19,29,24,497,560,269)) library(MASS) m-polr(size~carrier,data=tonsiles,weights=count) confint(m) Ulrich platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 3.0 year 2006 month 04 day24 svn rev37909 language R version.string Version 2.3.0 (2006-04-24) Ulrich Halekoh Danish Institute of Agricultural Sciences Unit of Statistics and Decision Analysis Denmark [[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] survival analysis with right and left censoring and time-dependent covariates
On Wed, 3 May 2006, Berta wrote: My question is: How could I fit a survival model that include right-left censoring and time-dependent covariates? Not with anything in the survival package, unfortunately. -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
[R] Net courses for R?
Are there any online courses for learning 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] Net courses for R?
Hello Scott, see: http://www.statistics.com/content/courses/R/index.html http://www.statistics.com/content/courses/graphicsR/index.html http://www.statistics.com/content/courses/modelingR/index.html there has been a recent posting on this list, if I recall it correctly. Best, B. -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Scott Cunningham Gesendet: Mittwoch, 3. Mai 2006 16:34 An: r-help@stat.math.ethz.ch Betreff: [R] Net courses for R? Are there any online courses for learning 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 * Confidentiality Note: The information contained in this mess...{{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
[R] Listing Variables
How does one create a vector whose contents is the list of variables in a dataframe pertaining to a particular pattern? This is so simple but I cannot find a straightforward answer. I want to be able to pass the contents of that list to a for loop. So let us assume that one has a dataframe whose name is Data. And let us assume one had the height of a group of people measured at various ages. It could be made up of vectors Data$PersonalID, Data$FirstName, Data$LastName, Data$Height.1, Data$Height.5, Data$Height.9, Data$Height.10,Data$Height.12,Data$Height.20many many more variables. How would one create a vector of all the Height variable names. The simple workaround is to not bother creating the vector Data$Height.1 Data$Height.5 Data$Height.9 Data$Height.10 Data$Height.12Data$Height.20...but rather just to use the sapply function. However with some functions the sapply will not work and it is necessary to supply each variable name to a function (see thread at Repeating tdt function on thousands of variables) This is such a core capability. I would like to see it in the R-Wiki but could not find it there. -- Farrel Buchinsky, MD Pediatric Otolaryngologist Allegheny General Hospital Pittsburgh, PA __ 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] Inverse X'WX matrix from weighted linear regression
Dear list, how can I compute the inverse of the X'WX matrix (inverse of the weighted sum of squares and crossproducts matrix) from an object of class lm from a weigthed linear regression? Thanks, Sven __ 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] Link to useR! 2006 from ww.r-project.org not working
I noticed that: http://www.r-project.org/useR-2006/ seems to be inexistent (page not found). Best, Bernhard Dr. Bernhard Pfaff Global Structured Products Group (Europe) Invesco Asset Management Deutschland GmbH Bleichstrasse 60-62 D-60313 Frankfurt am Main Tel: +49(0)69 298 07230 Fax: +49(0)69 298 07178 Email: [EMAIL PROTECTED] * Confidentiality Note: The information contained in this mess...{{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] Listing Variables
On Wed, 2006-05-03 at 10:46 -0400, Farrel Buchinsky wrote: How does one create a vector whose contents is the list of variables in a dataframe pertaining to a particular pattern? This is so simple but I cannot find a straightforward answer. I want to be able to pass the contents of that list to a for loop. So let us assume that one has a dataframe whose name is Data. And let us assume one had the height of a group of people measured at various ages. It could be made up of vectors Data$PersonalID, Data$FirstName, Data$LastName, Data$Height.1, Data$Height.5, Data$Height.9, Data$Height.10,Data$Height.12,Data$Height.20many many more variables. How would one create a vector of all the Height variable names. The simple workaround is to not bother creating the vector Data$Height.1 Data$Height.5 Data$Height.9 Data$Height.10 Data$Height.12Data$Height.20...but rather just to use the sapply function. However with some functions the sapply will not work and it is necessary to supply each variable name to a function (see thread at Repeating tdt function on thousands of variables) This is such a core capability. I would like to see it in the R-Wiki but could not find it there. I may be misunderstanding what you want to do, but to simply get the names of the columns in Data that contain Height, you can do this: grep(Height, names(Data), value = TRUE) [1] Height.1 Height.5 Height.9 Height.10 Height.12 [6] Height.20 Now you could use something like the following: for (i in grep(Height, names(Data), value = TRUE)) YourFunctionHere(Data[[i]]) If it makes for easier reading, you could first assign the subset of the column names to a vector and then use that in the for() loop, rather than the above. 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] Listing Variables
Farrel Buchinsky wrote: How does one create a vector whose contents is the list of variables in a dataframe pertaining to a particular pattern? This is so simple but I cannot find a straightforward answer. I want to be able to pass the contents of that list to a for loop. So let us assume that one has a dataframe whose name is Data. And let us assume one had the height of a group of people measured at various ages. It could be made up of vectors Data$PersonalID, Data$FirstName, Data$LastName, Data$Height.1, Data$Height.5, Data$Height.9, Data$Height.10,Data$Height.12,Data$Height.20many many more variables. How would one create a vector of all the Height variable names. The simple workaround is to not bother creating the vector Data$Height.1 Data$Height.5 Data$Height.9 Data$Height.10 Data$Height.12Data$Height.20...but rather just to use the sapply function. However with some functions the sapply will not work and it is necessary to supply each variable name to a function (see thread at Repeating tdt function on thousands of variables) vnames - paste(Height, 1:20, sep=.) for(vn in vnames){ doSomethingWith(Data[[vn]]) } Uwe Ligges This is such a core capability. I would like to see it in the R-Wiki but could not find it there. __ 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] Listing Variables
Column names in iris that contain the string Sepal: grep(Sepal, names(iris), value = TRUE) On 5/3/06, Farrel Buchinsky [EMAIL PROTECTED] wrote: How does one create a vector whose contents is the list of variables in a dataframe pertaining to a particular pattern? This is so simple but I cannot find a straightforward answer. I want to be able to pass the contents of that list to a for loop. So let us assume that one has a dataframe whose name is Data. And let us assume one had the height of a group of people measured at various ages. It could be made up of vectors Data$PersonalID, Data$FirstName, Data$LastName, Data$Height.1, Data$Height.5, Data$Height.9, Data$Height.10,Data$Height.12,Data$Height.20many many more variables. How would one create a vector of all the Height variable names. The simple workaround is to not bother creating the vector Data$Height.1 Data$Height.5 Data$Height.9 Data$Height.10 Data$Height.12Data$Height.20...but rather just to use the sapply function. However with some functions the sapply will not work and it is necessary to supply each variable name to a function (see thread at Repeating tdt function on thousands of variables) This is such a core capability. I would like to see it in the R-Wiki but could not find it there. -- Farrel Buchinsky, MD Pediatric Otolaryngologist Allegheny General Hospital Pittsburgh, PA __ 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] Listing Variables
Here's an example. dfr - data.frame(A1=1:10,A2=21:30,B1=31:40,B2=41:50) vars - colnames(dfr) for (v in vars[grep(B,vars)]) print(mean(dfr[,v])) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Farrel Buchinsky Sent: Wednesday, May 03, 2006 10:46 AM To: r-help@stat.math.ethz.ch Subject: [R] Listing Variables How does one create a vector whose contents is the list of variables in a dataframe pertaining to a particular pattern? This is so simple but I cannot find a straightforward answer. I want to be able to pass the contents of that list to a for loop. So let us assume that one has a dataframe whose name is Data. And let us assume one had the height of a group of people measured at various ages. It could be made up of vectors Data$PersonalID, Data$FirstName, Data$LastName, Data$Height.1, Data$Height.5, Data$Height.9, Data$Height.10,Data$Height.12,Data$Height.20many many more variables. How would one create a vector of all the Height variable names. The simple workaround is to not bother creating the vector Data$Height.1 Data$Height.5 Data$Height.9 Data$Height.10 Data$Height.12Data$Height.20...but rather just to use the sapply function. However with some functions the sapply will not work and it is necessary to supply each variable name to a function (see thread at Repeating tdt function on thousands of variables) This is such a core capability. I would like to see it in the R-Wiki but could not find it there. -- Farrel Buchinsky, MD Pediatric Otolaryngologist Allegheny General Hospital Pittsburgh, PA __ 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] Link to useR! 2006 from ww.r-project.org not working
Pfaff, Bernhard Dr. wrote: I noticed that: http://www.r-project.org/useR-2006/ seems to be inexistent (page not found). Probably lost during the move of CRAN master. For the meantime use http://www.ci.tuwien.ac.at/Conferences/useR-2006/ Uwe Ligges Best, Bernhard Dr. Bernhard Pfaff Global Structured Products Group (Europe) Invesco Asset Management Deutschland GmbH Bleichstrasse 60-62 D-60313 Frankfurt am Main Tel: +49(0)69 298 07230 Fax: +49(0)69 298 07178 Email: [EMAIL PROTECTED] * Confidentiality Note: The information contained in this mess...{{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 __ 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] Inverse X'WX matrix from weighted linear regression
I think you need summary(lm.obj)$cov.unscaled 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: Garbade, Sven [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Wednesday, May 03, 2006 5:01 PM Subject: [R] Inverse X'WX matrix from weighted linear regression Dear list, how can I compute the inverse of the X'WX matrix (inverse of the weighted sum of squares and crossproducts matrix) from an object of class lm from a weigthed linear regression? Thanks, Sven __ 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
[R] how to evaluate logistic model fit the data or not?
Dear list, I am new here. often times, I have a question about how to evaluate logistic model fit the data or not, do you guys can help me with some guidence? thanks. Youme -- Yuezhou Jing Center for Human Growth Development University of Michigan ___ ___ 300 N. Ingalls, Rm 1064 NE [ \/ ] Ann Arbor, MI 48109-0406 | \ / | Office: (734) 615-4673 | |\ \/ /| | FAX: (734) 936-9288 | | \ / | | 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] Inverse X'WX matrix from weighted linear regression
exactly! May thanks! -Original Message- From: Dimitris Rizopoulos [mailto:[EMAIL PROTECTED] Sent: Wed 5/3/2006 5:40 PM To: Garbade, Sven Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Inverse X'WX matrix from weighted linear regression I think you need summary(lm.obj)$cov.unscaled 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: Garbade, Sven [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Wednesday, May 03, 2006 5:01 PM Subject: [R] Inverse X'WX matrix from weighted linear regression Dear list, how can I compute the inverse of the X'WX matrix (inverse of the weighted sum of squares and crossproducts matrix) from an object of class lm from a weigthed linear regression? Thanks, Sven __ 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] Listing Variables
Uwe Ligges [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] vnames - paste(Height, 1:20, sep=.) Interesting but not suitable. It creates a name even if such a variable does not exist. I have 6000 variables. The numeric component of the variable name goes from 0 to about 1000. The output from the for loop would be largely empty space. Thanks for teaching me the paste() which will come in use later. I saw a response that makes use of names() or colnames() -- Farrel Buchinsky, MD Pediatric Otolaryngologist Allegheny General Hospital Pittsburgh, PA __ 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] Math expressions in pie chart labels?
On Tuesday 02 May 2006 23:33, Uwe Ligges wrote: Then please read ?plotmath and use it: labels = expression( = 0.66, == 0.33, = -0.33, = -0.66) Error in lab != : comparison is not allowed for expressions In addition: Warning message: is.na() applied to non-(list or vector) in: is.na(lab - labels[i]) I don't seem to be the only one having problems with this ;0) Joh pgpPq74G3CxiE.pgp Description: PGP 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
Re: [R] Math expressions in pie chart labels?
Johannes Graumann wrote: On Tuesday 02 May 2006 23:33, Uwe Ligges wrote: Then please read ?plotmath and use it: labels = expression( = 0.66, == 0.33, = -0.33, = -0.66) Error in lab != : comparison is not allowed for expressions In addition: Warning message: is.na() applied to non-(list or vector) in: is.na(lab - labels[i]) I don't seem to be the only one having problems with this ;0) Then please tell us the details, I just tried successfully: plot(1:10, xaxt=n) axis(1, at = c(1,3,5,7), labels = expression( = 0.66, == 0.33, = -0.33, = -0.66)) Uwe Ligges Joh __ 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] Link to useR! 2006 from ww.r-project.org not working
Yes, this has been reported to the webmasters (not really much point in telling a list). cran.r-project.org and www.r-project.org now point at machines at wu-wien.ac.at (the DNS was changed in the last 24 hours). I have also found that rsync is not being allowed through (e.g. for tools/rsync-recommended) and ftp cannot see the R data area. Doubtless it will all be back to normal in a day or two. On Wed, 3 May 2006, Pfaff, Bernhard Dr. wrote: I noticed that: http://www.r-project.org/useR-2006/ seems to be inexistent (page not found). Try http://www.ci.tuwien.ac.at/Conferences/useR-2006/ -- 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] Math expressions in pie chart labels?
On 5/3/06, Uwe Ligges [EMAIL PROTECTED] wrote: Johannes Graumann wrote: On Tuesday 02 May 2006 23:33, Uwe Ligges wrote: Then please read ?plotmath and use it: labels = expression( = 0.66, == 0.33, = -0.33, = -0.66) Error in lab != : comparison is not allowed for expressions In addition: Warning message: is.na() applied to non-(list or vector) in: is.na(lab - labels[i]) I don't seem to be the only one having problems with this ;0) Then please tell us the details, I just tried successfully: plot(1:10, xaxt=n) axis(1, at = c(1,3,5,7), labels = expression( = 0.66, == 0.33, = -0.33, = -0.66)) I think the discussion applies to pie: pie(c(1,3,5,7), labels = + expression( = 0.66, == 0.33, = -0.33, = -0.66)) Error in lab != : comparison is not allowed for expressions In addition: Warning message: is.na() applied to non-(list or vector) in: is.na(lab - labels[i]) __ 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] Math expressions in pie chart labels?
Gabor Grothendieck wrote: On 5/3/06, Uwe Ligges [EMAIL PROTECTED] wrote: Johannes Graumann wrote: On Tuesday 02 May 2006 23:33, Uwe Ligges wrote: Then please read ?plotmath and use it: labels = expression( = 0.66, == 0.33, = -0.33, = -0.66) Error in lab != : comparison is not allowed for expressions In addition: Warning message: is.na() applied to non-(list or vector) in: is.na(lab - labels[i]) I don't seem to be the only one having problems with this ;0) Then please tell us the details, I just tried successfully: plot(1:10, xaxt=n) axis(1, at = c(1,3,5,7), labels = expression( = 0.66, == 0.33, = -0.33, = -0.66)) I think the discussion applies to pie: pie(c(1,3,5,7), labels = + expression( = 0.66, == 0.33, = -0.33, = -0.66)) Error in lab != : comparison is not allowed for expressions In addition: Warning message: is.na() applied to non-(list or vector) in: is.na(lab - labels[i]) Ah, I see, this happens in pie()'s line: if (!is.na(lab - labels[i]) lab != ) { where lab is one element of the expression. I'd like to propose to change that line to if (!is.na(lab - labels[i]) nchar(lab) 0) { 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] Math expressions in pie chart labels?
Uwe Ligges wrote: Johannes Graumann wrote: On Tuesday 02 May 2006 23:33, Uwe Ligges wrote: Then please read ?plotmath and use it: labels = expression( = 0.66, == 0.33, = -0.33, = -0.66) Error in lab != : comparison is not allowed for expressions In addition: Warning message: is.na() applied to non-(list or vector) in: is.na(lab - labels[i]) I don't seem to be the only one having problems with this ;0) Then please tell us the details, I just tried successfully: plot(1:10, xaxt=n) axis(1, at = c(1,3,5,7), labels = expression( = 0.66, == 0.33, = -0.33, = -0.66)) As I was mentioning in my first post (see subject): this is a pie chart. Try: pie( c(20,40,60,80), labels = expression(NULL= 0.66,NULL= 0.33,NULL= -0.33,NULL= -0.66) ) or the '' equivalent. platform x86_64-pc-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu status major 2 minor 3.0 year 2006 month 04 day24 svn rev37909 language R version.string Version 2.3.0 (2006-04-24) Joh __ 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] Math expressions in pie chart labels?
On Wednesday 03 May 2006 09:05, Uwe Ligges wrote: Ah, I see, this happens in pie()'s line: if (!is.na(lab - labels[i]) lab != ) { where lab is one element of the expression. I'd like to propose to change that line to if (!is.na(lab - labels[i]) nchar(lab) 0) { What's the canonical way of patching something like this in R? Redefining the function at the start of your script? Joh pgpgSSNWEOKo8.pgp Description: PGP 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
Re: [R] Math expressions in pie chart labels?
Maybe because ?pie says labels: a vector of character strings giving names for the slices. For empty or NA labels, no pointing line is drawn either. Note, nothing about expressions pie() contains if (!is.na(lab - labels[i]) lab != ) { and so it would be easy to extend to something like if (!is.expression(lab - labels[i]) || (!is.na(lab) lab != )) { On Wed, 3 May 2006, Uwe Ligges wrote: Johannes Graumann wrote: On Tuesday 02 May 2006 23:33, Uwe Ligges wrote: Then please read ?plotmath and use it: labels = expression( = 0.66, == 0.33, = -0.33, = -0.66) Error in lab != : comparison is not allowed for expressions In addition: Warning message: is.na() applied to non-(list or vector) in: is.na(lab - labels[i]) I don't seem to be the only one having problems with this ;0) Then please tell us the details, I just tried successfully: plot(1:10, xaxt=n) axis(1, at = c(1,3,5,7), labels = expression( = 0.66, == 0.33, = -0.33, = -0.66)) Uwe Ligges Joh __ 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] garch in tseries
Dear Erin: The documentation for my currently installed version of garchFit{fSeries} indicates that the default include.mean = TRUE. How do you know it didn't work? With the default include.mean = TRUE, the following took just under a minute on my IBM T-30 notebook: library(fSeries) # Load Time Series: data(sp500dge) # Vector of Compounded Returns: x - diff(sp500dge[,1]) # Vector of Percentage Compounded Returns: X = 100*x fit = garchFit(~arma(0,1), ~garch(1,1), series = X) Moreover, print(fit) included a parameter 'mu' whose names suggests that it is a mean that might not bre estimated if 'include.mean = FALSE'. However, when I tried it, it went into an apparent infinite loop, which I killed after ~15-20 minutes: fit0 = garchFit(~arma(0,1), ~garch(1,1), series = X, include.mean=FALSE) I got a similar potentially infinite loop from the following: fit2 = garchFit(~arma(0,1), ~garch(1,1), series = X+100) However, the following converged and estimated mu at 0.1000, as simulated: fit.1 = garchFit(~arma(0,1), ~garch(1,1), series = X+0.1) Conclusion: The code seems to work as documented, sometimes. Unfortunately, it appears to have a disturbing affinity for an apparent infinite loop, and I don't have the time now to diagnose it further. hope this helps. spencer graves Erin Hodgess wrote: Hello again! Is there a way to include a mean in the garch function in the library(tseries), please? I tried include.mean=T in the function statement but it didn't work thanks in advance! R Version 2.2.1 Windows Sincerely, Erin 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 __ 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] sprintf question
How would one go about getting sprintf to use the values of a vector without having to specify each argument individually? v - c(1, 2, -1.197114, 0.1596687) iv - c(3, 1, 2, 4) sprintf(%9.2f\t%d\t%d\t%8.3f, v[3], v[1], v[2], v[4]) [1] -1.20\t1\t2\t 0.160 Essentially, desired effect would be something like: sprintf(%9.2f\t%d\t%d\t%8.3f, v[iv]) # wish it worked -- 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] Math expressions in pie chart labels?
On Wed, 3 May 2006, Johannes Graumann wrote: On Wednesday 03 May 2006 09:05, Uwe Ligges wrote: Ah, I see, this happens in pie()'s line: if (!is.na(lab - labels[i]) lab != ) { where lab is one element of the expression. I'd like to propose to change that line to if (!is.na(lab - labels[i]) nchar(lab) 0) { What's the canonical way of patching something like this in R? Redefining the function at the start of your script? There are namespace issues, so the canonical way is to change the sources and re-build R. (Anthing which imports the graphics namespace will get the system version, not yours.) -- 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] Nested model and variance partitioning
Dear R users, I face to a nested pattern and despite the numerous examples in the help I am still confused. I sampled bugs in different habitats within sites which were within rivers themselves within different regions. The habitat correspond to different substrata (not systematically present in all sites). For rivers and sites, I have environemental variables (e.g. altitude and slope of the site, drainage area and geology of the river) and I have only 2 regions. Note that sometimes I have only one site per river. I would like to know the part of each spatial scale in the species richness variance. I looked into the nlme package but I did not found how to proceed... Thanks for your help Nicolas Poulet Laboratoire d'Ecologie des Hydrosystèmes LEH - UMR UPS-CNRS 5177 Université Paul Sabatier, bât 4R3 118, route de Narbonne 31062 Toulouse Cedex 9 __ 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] sprintf question
Try this: do.call(sprintf, c(%9.2f\t%d\t%d\t%8.3f, as.list(v[iv]))) On 5/3/06, Paul Roebuck [EMAIL PROTECTED] wrote: How would one go about getting sprintf to use the values of a vector without having to specify each argument individually? v - c(1, 2, -1.197114, 0.1596687) iv - c(3, 1, 2, 4) sprintf(%9.2f\t%d\t%d\t%8.3f, v[3], v[1], v[2], v[4]) [1] -1.20\t1\t2\t 0.160 Essentially, desired effect would be something like: sprintf(%9.2f\t%d\t%d\t%8.3f, v[iv]) # wish it worked -- 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 __ 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] garch in tseries
Dear Erin: I just realized I had misread your question. Have you tried sending your question directly to the 'tseries' maintainer, listed with help(package=tseries)? While I misread your question earlier, it looks to me like you could get what you want by first subtracting some number close to the mean or median, then using garchFit{fSeries}. If you can't get that to work, could you please notify both Diethelm Wuertz and me? Best Wishes, spencer graves ### The documentation for my currently installed version of garchFit{fSeries} indicates that the default include.mean = TRUE. How do you know it didn't work? With the default include.mean = TRUE, the following took just under a minute on my IBM T-30 notebook: library(fSeries) # Load Time Series: data(sp500dge) # Vector of Compounded Returns: x - diff(sp500dge[,1]) # Vector of Percentage Compounded Returns: X = 100*x fit = garchFit(~arma(0,1), ~garch(1,1), series = X) Moreover, print(fit) included a parameter 'mu' whose names suggests that it is a mean that might not bre estimated if 'include.mean = FALSE'. However, when I tried it, it went into an apparent infinite loop, which I killed after ~15-20 minutes: fit0 = garchFit(~arma(0,1), ~garch(1,1), series = X, include.mean=FALSE) I got a similar potentially infinite loop from the following: fit2 = garchFit(~arma(0,1), ~garch(1,1), series = X+100) However, the following converged and estimated mu at 0.1000, as simulated: fit.1 = garchFit(~arma(0,1), ~garch(1,1), series = X+0.1) Conclusion: The code seems to work as documented, sometimes. Unfortunately, it appears to have a disturbing affinity for an apparent infinite loop, and I don't have the time now to diagnose it further. hope this helps. spencer graves Erin Hodgess wrote: Hello again! Is there a way to include a mean in the garch function in the library(tseries), please? I tried include.mean=T in the function statement but it didn't work thanks in advance! R Version 2.2.1 Windows Sincerely, Erin 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 __ 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] Making R talk to Win/OpenBUGS in Linux (again)
Finally fixed for the next release - and will also include the bugsLog() stuff as well. Best, Uwe Gregor Gorjanc wrote: Hello Paul, thank you very much for this report. You caught a bug in R2WinBUGS that was introduced by me. I added support for winepath in 1.1-1 version. Since I switch between Windows and Linux I always set WINEPATH and then use it in bugs(). That's why I forgot to add it in further calls in bugs(). How silly :( This actually means that nobody else beside you tried to run R2WinBUGS under Linux. To bad. Please report summary to BUGS list as you have also asked there for help and I did not had time to answer you. I have been successfully running R2WinBUGS under Linux for quite some time now. Now you have the following options: A Set WINEPATH before you call bugs() i.e. WINEPATH - /usr/bin/winepath bugs(..., WINEPATH=WINEPATH) This is the fastest approach for you. B Apply the following diffs, build and install R2WinBUGS by yourself I am also sendind them to maintainer of the package. So this should be fixed soon also on CRAN. Uwe? --- R2WinBUGSOrig/R/bugs.R 2006-04-29 21:44:59.0 +0200 +++ R2WinBUGS/R/bugs.R 2006-04-30 12:52:36.0 +0200 @@ -44,7 +44,7 @@ } else new.model.file - model.file bugs.script(parameters.to.save, n.chains, n.iter, n.burnin, n.thin, bugs.directory, new.model.file, debug=debug, is.inits=!is.null(inits), -bin = bin, DIC = DIC, useWINE = useWINE, newWINE = newWINE) +bin = bin, DIC = DIC, useWINE = useWINE, newWINE = newWINE, WINEPATH=WINEPATH) #if (useWINE missing(bugs.directory)) # bugs.directory - winedriveTr(bugs.directory) bugs.run(n.burnin, bugs.directory, WINE = WINE) --- R2WinBUGSOrig/R/bugs.script.R 2006-04-29 21:44:59.0 +0200 +++ R2WinBUGS/R/bugs.script.R 2006-04-30 12:52:12.0 +0200 @@ -1,7 +1,7 @@ bugs.script - function (parameters.to.save, n.chains, n.iter, n.burnin, n.thin, bugs.directory, model.file, debug=FALSE, is.inits, bin, -DIC = FALSE, useWINE = FALSE, newWINE = FALSE){ +DIC = FALSE, useWINE = FALSE, newWINE = FALSE, WINEPATH=NULL){ I'm back! I've just learned that, on a fully updated Fedora Core Linux5 sytem, the working solution to access Winbugs under wine via the R package rbugs no longer works. Here was my last post on this topic (with the formerly working solution) from January. http://finzi.psych.upenn.edu/R/Rhelp02a/archive/68497.html Currently, what happens is that WinBUGS starts up, but just sits there doing nothing. I do not know if the problem is due to a change in wine or rbugs, and since both of them are updated, it is hard to say. I'm thinking it is a wine or perhaps even a kernel related problem. Inside WinBUGS running under wine, it does not even work to manually open the bugs.script file and then choose Model/Script. it just returns a screen full of errors saying the commands fail. I don't think rbugs gets even that far, however, since the WinBUGS window does pop up, but nothing happens. rbugs has been retooled to emphasize use of linbugs, the OpenBUGS-based thing for linux, but I can't get linbugs to run at all on my system, and the linbugs program itself appears to have been removed from OpenBUGS distribution altogether. (I'm following that with separate email to the OpenBUGS group). I think JAGS is the right long term solution, but currently I'm in the middle of a semester trying to teach about Bayesian stats and the students have some familiarity with WinBUGS and I'm interested in making it work. So while I'm learning more about JAGS and the bayesmix package that supports access to it from R, I still would like a way to interact with Winbugs through Wine. If anybody has rbugs working in current Linux, please tell me how--give me a working example? In the meanwhile, I've noticed that nightly updates have successfully installed R2WinBUGS on linux systems and I've got a small test case that I'd like to ask about. Since rbugs is a linux adaptation of R2WinBUGS, and R2WinBUGS is now buildable on Linux, it looks like R2WinBUGS may be the way to go. But it fails. The error centers around the WINEPATH setting. I've learned that wine has a function winepath that returns information that programs can use, and I've fiddled this lots of ways, but it fails, saying Error in paste(WINEPATH, -w, x) : object WINEPATH not found library(R2WinBUGS) I hope that by giving you this small not-yet-working example, you can spot where I'm going wrong. ##Paul Johnson 2006-04-29 library(R2WinBUGS) # Copied from Prof Andrew Gelman's example model.file - system.file(package = R2WinBUGS, model, schools.txt) # file.show(model.file) data(schools) schools J - nrow(schools) y - schools$estimate sigma.y - schools$sd data - list (J, y, sigma.y) inits - function(){ list(theta = rnorm(J, 0, 100), mu.theta = rnorm(1, 0, 100), sigma.theta = runif(1, 0, 100)) } parameters -
Re: [R] sprintf question
You could finagle things with do.call (maybe right your own function that does this if you will use it often). Here is your example: v - c(1, 2, -1.197114, 0.1596687) iv - c(3, 1, 2, 4) tmp - c(list(%9.2f\t%d\t%d\t%8.3f),as.list(v[iv])) do.call('sprintf',tmp) [1] -1.20\t1\t2\t 0.160 Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Roebuck Sent: Wednesday, May 03, 2006 10:32 AM To: R Help Mailing List Subject: [R] sprintf question How would one go about getting sprintf to use the values of a vector without having to specify each argument individually? v - c(1, 2, -1.197114, 0.1596687) iv - c(3, 1, 2, 4) sprintf(%9.2f\t%d\t%d\t%8.3f, v[3], v[1], v[2], v[4]) [1] -1.20\t1\t2\t 0.160 Essentially, desired effect would be something like: sprintf(%9.2f\t%d\t%d\t%8.3f, v[iv]) # wish it worked -- 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 __ 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] sprintf question
On 5/3/2006 12:31 PM, Paul Roebuck wrote: How would one go about getting sprintf to use the values of a vector without having to specify each argument individually? v - c(1, 2, -1.197114, 0.1596687) iv - c(3, 1, 2, 4) sprintf(%9.2f\t%d\t%d\t%8.3f, v[3], v[1], v[2], v[4]) [1] -1.20\t1\t2\t 0.160 Essentially, desired effect would be something like: sprintf(%9.2f\t%d\t%d\t%8.3f, v[iv]) # wish it worked Like most R functions, the latter would be interpreted as a request for 4 strings corresponding to the 4 input values. What you want to do is probably easiest the way you did it, but it could also be done as do.call(sprintf, c(%9.2f\t%d\t%d\t%8.3f, as.list(v[iv]))) where the argument list to sprintf is being constructed programmatically. I'd certainly find the original version preferable if this were my code, but maybe the real situation is more complicated. Another possibility is to name the elements of v, then you can do things like v[foo], v[bar], etc. 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] factor to real - best way to convert
I have got factor from read.xls: is(factor_value) [1] factor oldClass [288] -0.32 0.180.180.18-0.32 0.180.68 [295] 0.680.18 43 Levels: -0.05 -0.13 -0.15 -0.18 -0.20 -0.26 ... 1.33 If I am using the funciton as.real(factor_value) I get [271] 17 17 8 22 8 8 17 17 17 17 17 17 17 17 23 7 35 7 [289] 23 23 23 7 23 35 35 23 So I used as.real(as.matrix(factor_value)) The result is as expected: [271]NANA -0.35 0.15 -0.35 -0.35NANANA [280]NANANANANA 0.18 -0.32 0.68 -0.32 [289] 0.18 0.18 0.18 -0.32 0.18 0.68 0.68 0.18 Ok I found the way to convert with try and error, but I do not understand the way - and I found the hint in the fullref_manual: x- as.numeric(levels(factor_value))[factor_value]) Ok much better, but I would not be able to find the way from the ?as.numeric help page. Both versions are complete struggled in my mind. maybe anybody is albe to write some hints for me. with regards Knut __ 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 to replace missing values with median value?
I have a data set with ~10 variables (i.e. columns). I wrote this little function to replace missing values with zero. sz - function(x) { ifelse(is.na(x)==F,x,0) } Can anyone help with a function that replaces missing values with the median of the non-missing values? __ 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 to replace missing values with median value?
sz - function(x) ifelse(is.na(x), median(x, na.rm=TRUE), x) Gabor On Wed, May 03, 2006 at 10:06:40AM -0700, r user wrote: I have a data set with ~10 variables (i.e. columns). I wrote this little function to replace missing values with zero. sz - function(x) { ifelse(is.na(x)==F,x,0) } Can anyone help with a function that replaces missing values with the median of the non-missing values? __ 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 -- Csardi Gabor [EMAIL PROTECTED]MTA RMKI, ELTE TTK __ 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] factor to real - best way to convert
You can use as.is = TRUE arg to read.xls to get character data rather than factors. On 5/3/06, Knut Krueger [EMAIL PROTECTED] wrote: I have got factor from read.xls: is(factor_value) [1] factor oldClass [288] -0.32 0.180.180.18-0.32 0.180.68 [295] 0.680.18 43 Levels: -0.05 -0.13 -0.15 -0.18 -0.20 -0.26 ... 1.33 If I am using the funciton as.real(factor_value) I get [271] 17 17 8 22 8 8 17 17 17 17 17 17 17 17 23 7 35 7 [289] 23 23 23 7 23 35 35 23 So I used as.real(as.matrix(factor_value)) The result is as expected: [271]NANA -0.35 0.15 -0.35 -0.35NANANA [280]NANANANANA 0.18 -0.32 0.68 -0.32 [289] 0.18 0.18 0.18 -0.32 0.18 0.68 0.68 0.18 Ok I found the way to convert with try and error, but I do not understand the way - and I found the hint in the fullref_manual: x- as.numeric(levels(factor_value))[factor_value]) Ok much better, but I would not be able to find the way from the ?as.numeric help page. Both versions are complete struggled in my mind. maybe anybody is albe to write some hints for me. with regards Knut __ 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] Math expressions in pie chart labels?
Prof Brian Ripley ripley at stats.ox.ac.uk writes: On Wed, 3 May 2006, Johannes Graumann wrote: What's the canonical way of patching something like this in R? Redefining the function at the start of your script? There are namespace issues, so the canonical way is to change the sources and re-build R. (Anthing which imports the graphics namespace will get the system version, not yours.) Or (to avoid re-building R) perhaps you could just make a copy of the function as mypie() and edit it? mypie - pie fix(mypie) ## make edits dump(mypie,file=mypie.R) source(mypie.R) ?? Ben __ 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] lme: how to compare random effects in two subsets of data
I thank you for your answer. It was really helpful. I purchased Pinheiro and Bates last year for the reasons you mentionned. I checked Sec. 5.2 and think I might use the following : model.var - update(model2,weights=varIdent(form=~1|Limb)) which gives : Variance function: Structure: Different standard deviations per stratum Formula: ~1 | Limb Parameter estimates: Left Right 1.00 1.039030 and test the model anova (model.var,model2) which shows no differences between the two models. Is this the right procedure? Does it means there is no statistical differences between variances of the two limbs (regardless of the day)? If I am right, I guess I should compare two other models with varIdent(form=~1|Day) and varIdent(form=~1|Day*Limb) to test if the difference of variance between the two limb is significant for between-day variation. Is this right? thank you for your help, Laurent Fanchon Ecole Nationale Vétérinaire d'Alfort National Vet School of Alfort (France) Spencer Graves a écrit : (comments in line) Laurent Fanchon wrote: Dear R-gurus, I have an interpretation problem regarding lme models. I am currently working on dog locomotion, particularly on some variation factors. I try to figure out which limb out of 2 generated more dispersed data. I record a value called Peak, around 20 times for each limb with a record. I repeat the records during a single day, and on several days. I tried to build two models, one for each limb : Dog.Left - lme (fixed=Peak~1, data=Loco, subset=Limb==Left,random=~1|Dog/Day/Record) Dog.Right - lme (fixed=Peak~1, data=Loco, subset=Limb==Right,random=~1|Dog/Day/Record) This allows to determine the variance attributable to each factor. Record represents the within-day variation, Day represents the between-day variation. This gives the following results : VarCorr (Dog.Left) Variance StdDev Dog = pdLogChol(1) (Intercept) 564.5558723.760384 Day =pdLogChol(1) (Intercept) 54.63027 7.391229 Record =pdLogChol(1) (Intercept) 23.29377 4.826362 Residual 27.46464 5.240672 VarCorr(Dog.Right) Variance StdDev Dog = pdLogChol(1) (Intercept) 552.1124623.497074 Day =pdLogChol(1) (Intercept) 70.72088 8.409571 Record =pdLogChol(1) (Intercept) 21.94594 4.684649 Residual 29.68476 5.448373 This shows that the variance might be different for each limb. For example, the variance attributable to Day might be higher for the Right limb. This is the first part of my interpretation, and I hope to be right. What do you think?? Then, the question is : are these differences statistically significant. I am not sure of how to investigate this question. I tried to compare several models : model1- lme (fixed=Peak~Limb, data=Loco, random=list(Dog=~Limb,Day=~Limb,Record=~Limb)) this is the more complicated model model2-lme (fixed=Peak~Limb, data=Loco, random=list(Dog=~Limb,Day=~Limb,Record=~1)) anova (model1,model2) showed no difference model3-lme (fixed=Peak~Limb, data=Loco, random=list(Dog=~Limb,Day=~1,Record=~1)) anova (model2,model3) showed a significant difference 0.0001 model2 seems to be the best model. Does it means the difference of variance between the two limb is significant for between-day variation and is unsignificant for within-day variation?? NO, it does NOT mean that the variance between the two limbs is significantly different between days. The model includes additive errors for each day as e[day]+e[day limb], and the contribution from e[day limb] is statistically significant. Finally VarCorr (model2) gives : Variance StdDevCorr Dog = pdLogChol(Limb)(Intercept) 567.553021 23.823371 (Intr) LimbRight 7.2490642.692409 -0.166 Day =pdLogChol(Limb)(Intercept) 53.888346 7.340868 (Intr) LimbRight 4.8633942.205310 0.363 This estimates var(e[day]) = 53.9 and var(e[day limb]) = 4.9. To test a difference in variance between limbs, please see Sec. 5.2 in Pinheiro and Bates (2000) Mixed-Effects Models in S and S-PLUS (Springer). I couldn't find the electronic catalog on the web site for the Bibliothèque de l'École nationale vétérinaire d’Alfort, so I couldn't check to see if they have a copy. If they don't, please feel free to advise them for me that you've heard that this is the best book on this subject available today, and it should find many users among researchers such as yourself. In my opinion, Doug Bates is the leading expert on variance components questions in the world today, and an institution such as the École nationale vétérinaire d’Alfort should have a copy of this book in their library, and their researchers who routinely must work with these kinds of data should make routine
[R] SAM analysis fold change output
Dear R users, I am have a question on SAM analysis - two class unpaired. I am not sure how exactly SAM calculates the fold change for logged2 transformed data. The output produced by SAM - rbind(siggenes.table$genes.up,siggenes.table$genes.lo) - has numerator, denominator, d-statistic, fold change and q value. Now if the data is log2 transformed then numerator = difference of means and the fold change should be = 2^(numerator). But this is not always true. For some genes it looks OK but for others the fold change calcuated by SAM is far different from that of 2^(numerator). So I think SAM considers a slightly different approach to estimate fold change. Do you know excatly how SAM estimates the fold change? Would really appreciate if you can help me with this. Thanks, ~Nikhil. Nikhil Garge Research Programmer Center for Biotech and Genomic Medicine Medical College of Georgia CA 4100, Augusta GA 30912 [[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] Math expressions in pie chart labels?
As a workaround you could use pie3D in the plotrix package with height=0 and theta=pi, e.g. library(plotrix) pie3D(1:3, height = 0, theta = pi, labels = expression( = 1, == 2, = 3)) On 5/3/06, Johannes Graumann [EMAIL PROTECTED] wrote: On Wednesday 03 May 2006 09:05, Uwe Ligges wrote: Ah, I see, this happens in pie()'s line: if (!is.na(lab - labels[i]) lab != ) { where lab is one element of the expression. I'd like to propose to change that line to if (!is.na(lab - labels[i]) nchar(lab) 0) { What's the canonical way of patching something like this in R? Redefining the function at the start of your script? Joh __ 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] Vector searching and counting speed optimization
R-users, I'm seeking any suggestions on optimizing some code for speed. Here's the setup: the code below is part of a larger chunk that is calculating Fst values across loci and alleles. This chunk is designed to calculate the proportion ('p.a') of an allele ('a') at a locus in each population ('p') and the proportion of individuals heterozygous for that allele ('h.a'). I'm not concerned with being slick in terms of using the most convenient functions, but would rather have it do the calculations as fast as possible as this bit is getting run very frequently and seems to be taking the most compute time. Profiling seems to indicate that functions like 'length(which(...))' and 'table(factor(...,level=a))' are more expensive than the logical vector creation scheme below. I just want to make sure I haven't overlooked any other viable options that might be available. Any and all suggestions are gladly welcomed. Thanks in advance. Cheers, eric --- Variables used : 'pop' - population i.d. , 'a1' 'a2' - alleles 1 and 2 at locus : all character vectors of equal length (no NAs) nvec - vector of number of individuals in population 'p' a - allele for which 'p.a' and 'p.het.a' are being calculated Here's some example data and then the code snippet in question: test - structure(list(pop = c(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3 ), loc4.a1 = c(3, 3, 4, 3, 3, 4, 4, 4, 3, 4, 4, 3, 4, 2, 4, 4, 4, 4, 2, 4, 2), loc4.a2 = c(3, 3, 3, 3, 4, 3, 3, 3, 2, 3, 3, 3, 4, 2, 3, 4, 3, 4, 1, 3, 1)), .Names = c(pop, loc4.a1, loc4.a2), na.action = structure(36, .Names = 36, class = omit), row.names = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21), class = data.frame) pop - test$pop a1 - test$loc4.a1 a2 - test$loc4.a2 nvec - table(pop) a - 3 with.a - a1 == a | a2 == a allele.stats - sapply(names(nvec), function(p) { this.pop - pop == p with.a a.in.a1 - a1[this.pop] == a a.in.a2 - a2[this.pop] == a na1 - length(a.in.a1[a.in.a1]) na2 - length(a.in.a2[a.in.a2]) p.a - (na1 + na2) / nvec[p] / 2 is.het - a1[this.pop] != a2[this.pop] p.het.a - length(is.het[is.het]) / nvec[p] c(p.a, p.het.a) }) -- Eric Archer, Ph.D. NOAA-SWFSC 8604 La Jolla Shores Dr. La Jolla, CA 92037 858-546-7121,7003(FAX) [EMAIL PROTECTED] Lighthouses are more helpful than churches. - Benjamin Franklin Cogita tute - Think for yourself __ 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] Vector searching and counting speed optimization
sum() looks faster to me tmp - as.logical(rbinom(100,1,.5)) system.time(for (i in 1:1) length(tmp[tmp])) [1] 0.09 0.00 0.09 NA NA system.time(for (i in 1:1) sum(tmp)) [1] 0.03 0.00 0.03 NA NA I am running on Windows XP Sys.getenv()[20] PROCESSOR_IDENTIFIER x86 Family 15 Model 2 Stepping 4, GenuineIntel __ 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] Permutation test of marked point pattern
Dear R users, I am trying to perform a hypothesis test on a marked point pattern. I would like to calculate the mean of the absolute value of the difference of marks between nearest neigbours, randomize the marks among points, then calculate this mean again. Ideally, I would test whether random mean values smaller than the observed mean value occur less than 5% of the time. I suppose 1000 permutations would be a reasonable starting point (the ppp object has 27 points). so far, I've figured out how to: -create a marked ppp object: ms.ppp -calculate my test statistic: teststat - mean(abs(markstat(ms.ppp, diff, N=2))) -randomly allocate marks to a point pattern: Y - rlabel (ms.ppp, labels=ms.ppp$marks, permute=TRUE) I have looked at perm.test{exactRankTests} and perused the R help archive but haven't been able to find how to work the permutation test with a marked ppp object. I thank you in advance for any help, J-F Savard Doctoral Candidate University of Maryland __ 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] Installation problem
I am trying to install R-2.3.0 on a 64bit linux box and encounter several error during the make step. I'd appreciate any help. Error messages follow: [EMAIL PROTECTED] R-2.3.0]# make make[4]: Entering directory `/state/partition1/apps/packages/R-2.3.0/src/modules/lapack' gcc -shared -L/usr/local/lib64 -o libRlapack.so dlamc.o dlapack0.o dlapack1.o dlapack2.o dlapack3.o cmplx.o -lf77blas -latlas -lg2c -lm -lgcc_s /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../lib64/libf77blas.a(xerbla.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../lib64/libf77blas.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[4]: *** [libRlapack.so] Error 1 make[4]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/src/modules/lapack' make[3]: *** [R] Error 2 make[3]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/src/modules/lapack' make[2]: *** [R] Error 1 make[2]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/src/modules' make[1]: *** [R] Error 1 make[1]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/src' make: *** [R] Error 1 [EMAIL PROTECTED] R-2.3.0]# make check FORCE=FORCE make[1]: Entering directory `/state/partition1/apps/packages/R-2.3.0/tests' make[2]: Entering directory `/state/partition1/apps/packages/R-2.3.0/tests' make[3]: Entering directory `/state/partition1/apps/packages/R-2.3.0/tests/Examples' make[4]: Entering directory `/state/partition1/apps/packages/R-2.3.0/tests/Examples' make[4]: `Makedeps' is up to date. make[4]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/tests/Examples' make[4]: Entering directory `/state/partition1/apps/packages/R-2.3.0/tests/Examples' whereami? at ../../tools/Rdnewer.pl line 26. make[4]: *** No rule to make target `../../src/library/base/all.R', needed by `base-Ex.Rout'. Stop. make[4]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/tests/Examples' make[3]: *** [test-Examples-Base] Error 2 make[3]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/tests/Examples' make[2]: *** [test-Examples] Error 2 make[2]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/tests' make[1]: *** [test-all-basics] Error 1 make[1]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/tests' make: *** [check] Error 2 -- # Shin-Han Shiu Michigan State University Dept. Plant Biology S-306 Plan Biolody Bldg. East Lansing, MI 48824-1312 (O) 517-353-7196 (L) 517-353-7244 shiusatmsudotedu http://shiulab.plantbiology.msu.edu # __ 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] Vector searching and counting speed optimization
Richard, Thanks! I never would've thought of using sum() to count the TRUEs in a logical vector, but it makes perfect sense. Cheers, e. Richard M. Heiberger wrote: sum() looks faster to me tmp - as.logical(rbinom(100,1,.5)) system.time(for (i in 1:1) length(tmp[tmp])) [1] 0.09 0.00 0.09 NA NA system.time(for (i in 1:1) sum(tmp)) [1] 0.03 0.00 0.03 NA NA I am running on Windows XP Sys.getenv()[20] PROCESSOR_IDENTIFIER x86 Family 15 Model 2 Stepping 4, GenuineIntel __ 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 -- Eric Archer, Ph.D. NOAA-SWFSC 8604 La Jolla Shores Dr. La Jolla, CA 92037 858-546-7121,7003(FAX) [EMAIL PROTECTED] Lighthouses are more helpful than churches. - Benjamin Franklin Cogita tute - Think for yourself __ 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] Aggregate?
Hello, I have a data set with a grouping variable (TRIPID) and several other variables. TRIPID is repeated in some areas and I would like to use a function like aggregate to sum the variable UNITS according to TRIPID. However I would also like to retain the other variables as they are in the data set with the new summed TRIPID. So what I have is something like this: YEARMONTH DAY CONTINUESPL AREACOUNTY DEPTH DEPUNIT GEARGEAR2 TRAPS SOAKTIMEUNITS FACTOR DISPOSIT NUMSETS TRIPST TRIPID 19921 26 1 SP0073928 8 25 4 NA 100 NA NA NA 161 1 NA NA NA 02163399054 19921 26 1 SP0073928 8 25 4 NA 100 NA NA NA 8 1 NA NA NA 02163399054 19921 26 2 SP0004228 8 25 4 NA 100 NA NA NA 161 1 NA NA NA 02163399054 19921 26 2 SP0004228 8 25 4 NA 100 NA NA NA 8 1 NA NA NA 02163399054 19921 25 NA SP0052652 8 25 4 NA 100 NA NA NA 85 1 NA NA NA 02163399057 19921 26 NA SP0037940 8 25 4 NA 100 NA NA NA 70 1 NA NA NA 02163399058 19921 27 NA SP0072357 8 25 4 NA 100 NA NA NA 15 1 NA NA NA 02163399059 19921 27 NA SP0072357 8 25 4 NA 100 NA NA NA 20 1 NA NA NA 02163399059 19921 27 NA SP0026324 8 25 4 NA 100 NA NA NA 8 1 NA NA NA 02163399060 19921 28 1 SP0072357 8 25 4 NA 100 NA NA NA 2001 NA NA NA 02163399062 And what I want is this: YEARMONTH DAY CONTINUESPL AREACOUNTY DEPTH DEPUNIT GEARGEAR2 TRAPS SOAKTIMEUNITS FACTOR DISPOSIT NUMSETS TRIPST TRIPID 19921 26 1 SP0073928 8 25 4 NA 100 NA NA NA 3381 NA NA NA 02163399054 19921 25 NA SP0052652 8 25 4 NA 100 NA NA NA 85 1 NA NA NA 02163399057 19921 26 NA SP0037940 8 25 4 NA 100 NA NA NA 70 1 NA NA NA 02163399058 19921 27 NA SP0072357 8 25 4 NA 100 NA NA NA 35 1 NA NA NA 02163399059 19921 27 NA SP0026324 8 25 4 NA 100 NA NA NA 8 1 NA NA NA 02163399060 19921 28 1 SP0072357 8 25 4 NA 100 NA NA NA 2001 NA NA NA 02163399062 Does anyone know how to do this. Data file is attached. Thanks in advance Cameron Guenther, Ph.D. Associate Research Scientist FWC/FWRI, Marine Fisheries Research 100 8th Avenue S.E. St. Petersburg, FL 33701 (727)896-8626 Ext. 4305 [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] Installation problem
As it says, your ATLAS library has not compiled for use in a shared object. This is discussed in the R-admin manual which you were asked to read (in the INSTALL file) if you have any problems. You don't even tell us what Linux distro this is. Try configuring with --without-blas. On Wed, 3 May 2006, Shinhan Shiu wrote: I am trying to install R-2.3.0 on a 64bit linux box and encounter several error during the make step. I'd appreciate any help. Error messages follow: [EMAIL PROTECTED] R-2.3.0]# make make[4]: Entering directory `/state/partition1/apps/packages/R-2.3.0/src/modules/lapack' gcc -shared -L/usr/local/lib64 -o libRlapack.so dlamc.o dlapack0.o dlapack1.o dlapack2.o dlapack3.o cmplx.o -lf77blas -latlas -lg2c -lm -lgcc_s /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../lib64/libf77blas.a(xerbla.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-redhat-linux/3.4.4/../../../../lib64/libf77blas.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[4]: *** [libRlapack.so] Error 1 make[4]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/src/modules/lapack' make[3]: *** [R] Error 2 make[3]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/src/modules/lapack' make[2]: *** [R] Error 1 make[2]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/src/modules' make[1]: *** [R] Error 1 make[1]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/src' make: *** [R] Error 1 [EMAIL PROTECTED] R-2.3.0]# make check FORCE=FORCE make[1]: Entering directory `/state/partition1/apps/packages/R-2.3.0/tests' make[2]: Entering directory `/state/partition1/apps/packages/R-2.3.0/tests' make[3]: Entering directory `/state/partition1/apps/packages/R-2.3.0/tests/Examples' make[4]: Entering directory `/state/partition1/apps/packages/R-2.3.0/tests/Examples' make[4]: `Makedeps' is up to date. make[4]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/tests/Examples' make[4]: Entering directory `/state/partition1/apps/packages/R-2.3.0/tests/Examples' whereami? at ../../tools/Rdnewer.pl line 26. make[4]: *** No rule to make target `../../src/library/base/all.R', needed by `base-Ex.Rout'. Stop. make[4]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/tests/Examples' make[3]: *** [test-Examples-Base] Error 2 make[3]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/tests/Examples' make[2]: *** [test-Examples] Error 2 make[2]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/tests' make[1]: *** [test-all-basics] Error 1 make[1]: Leaving directory `/state/partition1/apps/packages/R-2.3.0/tests' make: *** [check] Error 2 -- 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] Aggregate?
Suppose we want to sum C over levels of A and that B is constant within levels of A. Then: DF - data.frame(A = gl(2,2), B = gl(2,2), C = 1:4) # test data do.call(rbind, by(DF, DF$A, function(x) replace(x[1,], C, sum(x$C On 5/3/06, Guenther, Cameron [EMAIL PROTECTED] wrote: Hello, I have a data set with a grouping variable (TRIPID) and several other variables. TRIPID is repeated in some areas and I would like to use a function like aggregate to sum the variable UNITS according to TRIPID. However I would also like to retain the other variables as they are in the data set with the new summed TRIPID. So what I have is something like this: YEARMONTH DAY CONTINUESPL AREACOUNTY DEPTH DEPUNIT GEARGEAR2 TRAPS SOAKTIMEUNITS FACTOR DISPOSIT NUMSETS TRIPST TRIPID 19921 26 1 SP0073928 8 25 4 NA 100 NA NA NA 161 1 NA NA NA 02163399054 19921 26 1 SP0073928 8 25 4 NA 100 NA NA NA 8 1 NA NA NA 02163399054 19921 26 2 SP0004228 8 25 4 NA 100 NA NA NA 161 1 NA NA NA 02163399054 19921 26 2 SP0004228 8 25 4 NA 100 NA NA NA 8 1 NA NA NA 02163399054 19921 25 NA SP0052652 8 25 4 NA 100 NA NA NA 85 1 NA NA NA 02163399057 19921 26 NA SP0037940 8 25 4 NA 100 NA NA NA 70 1 NA NA NA 02163399058 19921 27 NA SP0072357 8 25 4 NA 100 NA NA NA 15 1 NA NA NA 02163399059 19921 27 NA SP0072357 8 25 4 NA 100 NA NA NA 20 1 NA NA NA 02163399059 19921 27 NA SP0026324 8 25 4 NA 100 NA NA NA 8 1 NA NA NA 02163399060 19921 28 1 SP0072357 8 25 4 NA 100 NA NA NA 2001 NA NA NA 02163399062 And what I want is this: YEARMONTH DAY CONTINUESPL AREACOUNTY DEPTH DEPUNIT GEARGEAR2 TRAPS SOAKTIMEUNITS FACTOR DISPOSIT NUMSETS TRIPST TRIPID 19921 26 1 SP0073928 8 25 4 NA 100 NA NA NA 3381 NA NA NA 02163399054 19921 25 NA SP0052652 8 25 4 NA 100 NA NA NA 85 1 NA NA NA 02163399057 19921 26 NA SP0037940 8 25 4 NA 100 NA NA NA 70 1 NA NA NA 02163399058 19921 27 NA SP0072357 8 25 4 NA 100 NA NA NA 35 1 NA NA NA 02163399059 19921 27 NA SP0026324 8 25 4 NA 100 NA NA NA 8 1 NA NA NA 02163399060 19921 28 1 SP0072357 8 25 4 NA 100 NA NA NA 2001 NA NA NA 02163399062 Does anyone know how to do this. Data file is attached. Thanks in advance Cameron Guenther, Ph.D. Associate Research Scientist FWC/FWRI, Marine Fisheries Research 100 8th Avenue S.E. St. Petersburg, FL 33701 (727)896-8626 Ext. 4305 [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list
[R] mca id numbers
Is it possible to make disappear the id numbers from scatter.dudi (mc analysis) ? a - as.factor(c(1, 2, 3, 2, 1)) b - as.factor(c(3, 2, 3, 1, 1)) x - as.factor(c(1, 2, 2, 1, 3)) y - as.factor(c(2, 2, 3, 1, 1)) dat - data.frame(a=a, b=b,x=x,y=y) summary(dat) dat require(ade4) dat.acm - dudi.acm(dat, scann = FALSE, nf = 2) scatter.dudi(dat.acm) Thank you very much ! Mauricio __ 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] Test if an image or random field is stationary
Hi List, I want to know how to test whether an image or generally a random field, is stationary. I am sure there are a lot of intuitive ways to do this but right now I need a formal test which can gives the p-value. And any of those tests already implemented in R? Thanks a lot! Yuefeng [[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] Outreg-like command?
It would be nice to have something like stata's outreg that lets regression output go into a form like Specification (1) Specification (2) Var 1 coef(1,1) coef(1,2) se(1,1) se(1,2) Var 2 coef(2,1) coef(2,2) se(2,1) se(2,2) I don't think this can be done in xtable? Thomas Davidoff Assistant Professor Haas School of Business UC Berkeley Berkeley, CA 94618 Phone:(510) 643-1425 Fax:(510) 643-7357 email:[EMAIL PROTECTED] web:http://faculty.haas.berkeley.edu/davidoff/ __ 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 GDD fonts
Hi After a little work i found a way of using near 8bit color output in GDD. I edited the GDD/src/GDDtalk.c file... There was this loop: if (!strcmp(it, png8)) { if (nl3 strcmp(fn+nl-4,.png)) strcat(fn, .png); out = fopen (fn, wb); if (out) { gdImagePng (xd-img, out); fclose (out); } return; } and I added a line... if (!strcmp(it, png8)) { if (nl3 strcmp(fn+nl-4,.png)) strcat(fn, .png); out = fopen (fn, wb); if (out) { gdImageTrueColorToPalette (xd-img, 0, 256); gdImagePng (xd-img, out); fclose (out); } return; } I compiled again and now my GDD works in TrueColor, but with only those 256 colors... Its not an ellegant solution, but it really dropped the image size... now my files are 3 times smaller! thanks for your assistance! 2006/4/13, Jeffrey Horner [EMAIL PROTECTED]: Luiz Rodrigo Tozzi wrote: Hi Tim, It really worked!! thanks! now my only problem is about the image size, that is huge! im using the type=png and switching to png8 does not reduce the color depth.. do you know something about is? I've hacked around on the GDD code before. From what I remember, all png files are created in true color. 2006/4/12, Tim Churches [EMAIL PROTECTED]: Luiz Rodrigo Tozzi wrote: Hi I was searching for some X replacement for my job in R and i found the GDD I installed it and I match all the system requirements. My problem (maybe a dumb one) is that every plot comes with no font and i cant find a simgle example of a plot WITH FONT DETAIL in the list can anybody help me? a simple example: library(GDD) GDD(something.png, type=png, width = 700, height = 500) par(cex.axis=0.65,lab=c(12,12,0),mar=c(2.5, 2.5, 2.5, 2.5)) plot(rnorm(100)) mtext(Something,side=3,padj=-0.33,cex=1) dev.off() thanks in advance! This might help - we found that we needed to install the MS TT fonts and make sure that GDD can find them, as per the README. : Simon Urbanek [EMAIL PROTECTED] wrote: Tim, On Jun 9, 2005, at 3:51 AM, Tim CHURCHES wrote: I tried GDD 0.1-7 with Lattice graphs in R 2.1.0 (on Linux). It doesn't segfault now but it is still not producing any usable output - the output png file is produced but nly with a few lines on it. Still the alpha channel problem? Have you been able to produce any Lattice graphs with it? I know of no such problem, I tested a few lattice graphics and they worked. Can you, please, send me reproducible example and your output? Also send me, please output of library(GDD) .Call(gdd_look_up_font, NULL) Sorry, my laziness. GDD was unable to find any fonts. After I installed the MS TT fonts and set their location as per the GDD README, it worked perfectly with both old-style R graphics and lattice graphics. The output looks very nice indeed. We'll do a bit more testing (and let you know if we find any problems), but it looks like we can at last drop the requirement for Xvfb when using R in a Web application. Great work! From our point of view, GDD solves one the biggest problem with R for Web applications. Cheers, Tim C -- Luiz Rodrigo Lins Tozzi [EMAIL PROTECTED] (21)91318150 http://luizrodrigotozzi.multiply.com/ http://www.flogao.com.br/luizrodrigotozzi __ 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 -- Jeffrey Horner Computer Systems Analyst School of Medicine 615-322-8606 Department of Biostatistics Vanderbilt University -- Luiz Rodrigo Lins Tozzi [EMAIL PROTECTED] (21)91318150 http://luizrodrigotozzi.multiply.com/ http://www.flogao.com.br/luizrodrigotozzi __ 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] Outreg-like command?
I think this is what you are asking for. It would be relatively easy to package this into a function that takes a list of lm objects as its argument. tmp - data.frame(matrix(rnorm(100), 25, 4)) names(tmp) - c(y,x1,x2,x3) t1.lm - lm(y ~ x1, data=tmp) t2.lm - lm(y ~ x2, data=tmp) t3.lm - lm(y ~ x3, data=tmp) t12.lm - lm(y ~ x1 + x2, data=tmp) t13.lm - lm(y ~ x1 + x3, data=tmp) t23.lm - lm(y ~ x2 + x3, data=tmp) t123.lm - lm(y ~ x1 + x2 +x3, data=tmp) vars - list(names(coef(t1.lm)), names(coef(t2.lm)), names(coef(t3.lm)), names(coef(t12.lm)), names(coef(t13.lm)), names(coef(t23.lm)), names(coef(t123.lm)) ) outreg - array(0, dim=c(7, length(unique(unlist(vars))),2), dimnames=list( c(deparse(terms(t1.lm)), deparse(terms(t2.lm)), deparse(terms(t3.lm)), deparse(terms(t12.lm)), deparse(terms(t13.lm)), deparse(terms(t23.lm)), deparse(terms(t123.lm))), unique(unlist(vars)), c(coef,se))) outreg[1, vars[[1]], ] - coef(summary(t1.lm)) [vars[[1]], c(Estimate, Std. Error)] outreg[2, vars[[2]], ] - coef(summary(t2.lm)) [vars[[2]], c(Estimate, Std. Error)] outreg[3, vars[[3]], ] - coef(summary(t3.lm)) [vars[[3]], c(Estimate, Std. Error)] outreg[4, vars[[4]], ] - coef(summary(t12.lm)) [vars[[4]], c(Estimate, Std. Error)] outreg[5, vars[[5]], ] - coef(summary(t13.lm)) [vars[[5]], c(Estimate, Std. Error)] outreg[6, vars[[6]], ] - coef(summary(t23.lm)) [vars[[6]], c(Estimate, Std. Error)] outreg[7, vars[[7]], ] - coef(summary(t123.lm))[vars[[7]], c(Estimate, Std. Error)] outreg __ 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] install R under suse: packages dependency
Hi all I'm trying to install R 2.3.0 under Suse 10.0. As I'm using SSH to login into the SUSE server, I can't use YAST2, so I have to use rpm -i in the shell. The system tells me that I need some other packages such as xorg-x11-fonts-100dpi, blas, libgfortran.so.0(). Is there some website where I can download and install these packages? Thanks a lot! Zhihua Li __ 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] install R under suse: packages dependency
[zhihua li] I'm trying to install R 2.3.0 under Suse 10.0. As I'm using SSH to login into the SUSE server, I can't use YAST2, I presume this is because you cannot remotely mount the CD's or DVD's? The next time you visit your server, if possible, copy your distribution media to your hard disks, you'll find out that this is really a useful thing to do. You can later use YaST2 to install from the copies you made, even remotely. There is no problem using YaST2 over SSH, either in graphical mode (if you used `ssh -X') or in text mode. In my experience, R 2.3.0 installs painlessly under SuSE 10.0, and needs nothing which is not already available on the distribution media. Should I say, I'm still impressed (even astonished) that R installation succeeds so easily, given the size and complexity of the distribution. -- François Pinard http://pinard.progiciels-bpi.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] install R under suse: packages dependency
Thanks for your tips. But I don't understand why coping the distribution media to the server's hard disks would enable me to use yast2 remotely with ssh? Actually I can launch yast2 remotely now. After connecting to the remote server by ssh and then typing yast2, a yast interface will appear within my shell. But I can't seem to control the yast2 panel, as most of the hot keys and arrows on the yast control panal are not working anymore, i.e., I can't navigate through the yast control panel with my local keyboard. It just got stuck there in my shell. I can't even quit the yast interface. My local machine is a mac, I don't know if that's the problem. From: Fran�ois Pinard [EMAIL PROTECTED] To: zhihua li [EMAIL PROTECTED] CC: r-help@stat.math.ethz.ch Subject: Re: [R] install R under suse: packages dependency Date: Wed, 3 May 2006 21:24:24 -0400 [zhihua li] I'm trying to install R 2.3.0 under Suse 10.0. As I'm using SSH to login into the SUSE server, I can't use YAST2, I presume this is because you cannot remotely mount the CD's or DVD's? The next time you visit your server, if possible, copy your distribution media to your hard disks, you'll find out that this is really a useful thing to do. You can later use YaST2 to install from the copies you made, even remotely. There is no problem using YaST2 over SSH, either in graphical mode (if you used `ssh -X') or in text mode. In my experience, R 2.3.0 installs painlessly under SuSE 10.0, and needs nothing which is not already available on the distribution media. Should I say, I'm still impressed (even astonished) that R installation succeeds so easily, given the size and complexity of the distribution. -- Fran�ois Pinard http://pinard.progiciels-bpi.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 to evaluate logistic model fit the data or not?
Youme, The question has been asked before, you can have a look at the R archives for that issue using: RSiteSearch(logistic goodness of fit). Last time I did this, the command found some 53 entries! Hope it helps, Augusto Augusto Sanabria. MSc, PhD. Mathematical Modeller Risk Research Group Geospatial Earth Monitoring Division Geoscience Australia (www.ga.gov.au) Cnr. Jerrabomberra Av. Hindmarsh Dr. Symonston ACT 2609 Ph. (02) 6249-9155 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Yuezhou(Jerry) Jing Sent: Thursday, 4 May 2006 1:18 AM To: r-help@stat.math.ethz.ch Subject: [R] how to evaluate logistic model fit the data or not? Dear list, I am new here. often times, I have a question about how to evaluate logistic model fit the data or not, do you guys can help me with some guidence? thanks. Youme -- Yuezhou Jing Center for Human Growth Development University of Michigan ___ ___ 300 N. Ingalls, Rm 1064 NE [ \/ ] Ann Arbor, MI 48109-0406 | \ / | Office: (734) 615-4673 | |\ \/ /| | FAX: (734) 936-9288 | | \ / | | 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-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] install R under suse: packages dependency
On Wednesday 03 May 2006 20:28, zhihua li wrote: Hi all I'm trying to install R 2.3.0 under Suse 10.0. As I'm using SSH to login into the SUSE server, I can't use YAST2, so I have to use rpm -i in the shell. The system tells me that I need some other packages such as xorg-x11-fonts-100dpi, blas, libgfortran.so.0(). Is there some website where I can download and install these packages? Thanks a lot! Zhihua Li You CAN use YAST in SSH. Just type yast at the command line. You will get yast in ncurses (text) mode. I recently configured an entire server this way. Do you have root access? You have to have the installation sources configured correctly. Are your installation sources configured? Larry Howe __ 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] Repeating tdt function on thousands of variables
Uwe Ligges ligges at statistik.uni-dortmund.de writes: The same way. lapply() and sapply() should work for almost all functions given, if nothing strange happens with environemnts, which is the case here: The problem is tdt() itself. Note that it has its argument data set to sys.frame(sys.parent()) as the default, but l/sapply are evaluating in a different environment! I communicated with David Clayton, the person who wrote dgc.genetics. He was indeed able to get lapply() and sapply() to work. However I could only get it do so when I change the variable names to match tdt's default variable names. tdt lets one specify which variable should be used for pedigree, which for person ID etcetera. However, I could never get lapply to work when one used the tdt in that setting. Farrel Buchinsky __ 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] install R under suse: packages dependency
Larry I tried using yast in my shell ( i have the root authority). The yast ncurses did appear in my shell, but i can't control the panel. For example, it says press F1 for help, but pressing my F1 just resulted in decrease of my screen light (the default function of the F1 key in mac). So even though I launched the yast2 ncurses, I couldn't use it. As for the installation sources, you meant suse or r? Zhihua Li From: Larry Howe [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject: Re: [R] install R under suse: packages dependency Date: Wed, 3 May 2006 22:40:28 -0400 On Wednesday 03 May 2006 20:28, zhihua li wrote: Hi all I'm trying to install R 2.3.0 under Suse 10.0. As I'm using SSH to login into the SUSE server, I can't use YAST2, so I have to use rpm -i in the shell. The system tells me that I need some other packages such as xorg-x11-fonts-100dpi, blas, libgfortran.so.0(). Is there some website where I can download and install these packages? Thanks a lot! Zhihua Li You CAN use YAST in SSH. Just type yast at the command line. You will get yast in ncurses (text) mode. I recently configured an entire server this way. Do you have root access? You have to have the installation sources configured correctly. Are your installation sources configured? Larry Howe __ 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] install R under suse: packages dependency
Zhihua, In Linux you use the tab key to move from field to field, or you can go alt-O for example to hit the OK button. Windows is similar. You need the suse installation source to be configured so that it can load the dependent packages (libgfortran, etc.). Larry On Wednesday 03 May 2006 22:53, zhihua li wrote: Larry I tried using yast in my shell ( i have the root authority). The yast ncurses did appear in my shell, but i can't control the panel. For example, it says press F1 for help, but pressing my F1 just resulted in decrease of my screen light (the default function of the F1 key in mac). So even though I launched the yast2 ncurses, I couldn't use it. As for the installation sources, you meant suse or r? Zhihua Li From: Larry Howe [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject: Re: [R] install R under suse: packages dependency Date: Wed, 3 May 2006 22:40:28 -0400 On Wednesday 03 May 2006 20:28, zhihua li wrote: Hi all I'm trying to install R 2.3.0 under Suse 10.0. As I'm using SSH to login into the SUSE server, I can't use YAST2, so I have to use rpm -i in the shell. The system tells me that I need some other packages such as xorg-x11-fonts-100dpi, blas, libgfortran.so.0(). Is there some website where I can download and install these packages? Thanks a lot! Zhihua Li You CAN use YAST in SSH. Just type yast at the command line. You will get yast in ncurses (text) mode. I recently configured an entire server this way. Do you have root access? You have to have the installation sources configured correctly. Are your installation sources configured? Larry Howe __ 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] measuring goodness of fit in quantile regression
Hello, Does anybody know how to calculate local goodness of fit at the different quantiles of a censored quantile regression? I suppose I am looking to see if there is a specific command in R for this... Thanks for your help, Tanya __ 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] Repeating tdt function on thousands of variables
I am using dgc.genetics to perform TDT analysis on SNP data from a cohort of trios. I now have a file with about 6008 variables. The first few variables related to the pedigree data such as the pedigree ID the person ID etc. Thereafter each variable is a specific locus or marker. The variables are named by a pattern such as Genotype.n with n corresponding to a number which is the name or id of the locus. I am able to get the tdt to run by each locus. tdt(Genotype.914186, PGWide, famid, pid, fatid, motid, sex, affected ) Clearly I cannot type each locus in one at a time. Instead I want to loop it but am not sure how to do it. I tried lapply but it did not really work. -- Farrel Buchinsky, MD Pediatric Otolaryngologist Allegheny General Hospital Pittsburgh, PA Something like: pos.first.marker - 8 Nsnps - nrow(your.data)-pos.first.marker+1 res - double(Nsnps) names(res) - names(your.data)[-seq(1,pos.first.marker-1)] for (i in seq(1, Nsnps)) { res[i] - tdt(your.data[,i], your.data)$p.value[2] } David Duffy | David Duffy (MBBS PhD) ,-_|\ | email: [EMAIL PROTECTED] ph: INT+61+7+3362-0217 fax: -0101 / * | Epidemiology Unit, Queensland Institute of Medical Research \_,-._/ | 300 Herston Rd, Brisbane, Queensland 4029, Australia GPG 4D0B994A v __ 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 clipboard problem while using R2HTML
I followed the examples of previous posts about R2HTML to practice exporting a data to a clipboard, but the result is not as smooth as I had expected: library(R2HTML) data(iris) HTML(iris, file(clipboard,w), append=FALSE) I got an error message: HTML(iris, file(clipboard,w), append=FALSE) Error in file(clipboard, w) : 'mode' for the clipboard must be 'r' on Unix I changed w to r, but there seems a clipboard problem: HTML(iris, file(clipboard,r), append=FALSE) Error: clipboard connection is open for reading only The only setting about the clipboard is in my .emacs is: '(x-select-enable-clipboard t)) Thank you in advance for any hint. I am using Linux Fedora 4. Kernel 2.6.15-1.1833_1. R version 2.3.0, ESS 5.3.0. -Frank __ 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] New-user support package - suggestions?
Dear Community, This is largely a repost with some new information. I'm interested in developing a package that could ease the command-line learning curve for new users. It would provide more detailed syntax checking and commentary as feedback. It would try to anticipate common new-user errors, and provide feedback to help correct them. As a trivial example, instead of mean(c(1,2,NA)) [1] NA we might have mean(c(1,2,NA)) [1] NA Warning: your data contains missing values. If you wish to ignore these for the purposes of computing the mean, use the argument: na.rm=TRUE. I'm interested in any thoughts that people have about this idea - what errors do you commonly see, and how can they be dealt with? I have funding for 6 weeks of programming support for this idea. All suggestions are welcome. Cheers, Andrew -- Andrew Robinson Department of Mathematics and StatisticsTel: +61-3-8344-9763 University of Melbourne, VIC 3010 Australia Fax: +61-3-8344-4599 Email: [EMAIL PROTECTED] http://www.ms.unimelb.edu.au __ 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] [Re:] function to replace missing values with median value?]]
The following should work sz - function(x) { ifelse(is.na(x) == F, x, median(x, na.rm=TRUE)) } best, isaia. Original Message Subject: [R] function to replace missing values with median value? Date: Wed, 3 May 2006 10:06:40 -0700 (PDT) From: r user [EMAIL PROTECTED] To: rhelp r-help@stat.math.ethz.ch I have a data set with ~10 variables (i.e. columns). I wrote this little function to replace missing values with zero. “ sz - function(x) { ifelse(is.na(x)==F,x,0) } “ Can anyone help with a function that replaces missing values with the median of the non-missing values? __ 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 -- ~~~ ~ Ennio D. Isaia ~ Dep. of Statistics Applied Mathematics, University of Torino ~ Piazza Arbarello, 8 - 10122 Torino (Italy) ~ Phone: +39 011 670 57 29 ~~ Fax: +39 011 670 57 83 ~~~ __ 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: [Re:] function to replace missing values with median value?]]
there is also a replace function -Messaggio originale- Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] conto di [EMAIL PROTECTED] Inviato: Thursday, May 04, 2006 07:31 AM A: [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Oggetto: [R] [Re:] function to replace missing values with median value?]] The following should work sz - function(x) { ifelse(is.na(x) == F, x, median(x, na.rm=TRUE)) } best, isaia. Original Message Subject: [R] function to replace missing values with median value? Date: Wed, 3 May 2006 10:06:40 -0700 (PDT) From: r user [EMAIL PROTECTED] To: rhelp r-help@stat.math.ethz.ch I have a data set with ~10 variables (i.e. columns). I wrote this little function to replace missing values with zero. “ sz - function(x) { ifelse(is.na(x)==F,x,0) } “ Can anyone help with a function that replaces missing values with the median of the non-missing values? __ 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 -- ~~~ ~ Ennio D. Isaia ~ Dep. of Statistics Applied Mathematics, University of Torino ~ Piazza Arbarello, 8 - 10122 Torino (Italy) ~ Phone: +39 011 670 57 29 ~~ Fax: +39 011 670 57 83 ~~~ __ 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