[R] Exercises for 'Using R'
Hello everyone, We have started a very small R study group here in Berlin, Germany. Since we're all relatively new to R we are using 'Using R for Introductory Statistics' by John Verzani (one used that at a course once). Is there anyone who have exercisers fitting for group discussions, preferably following the chapters of John's book? The exercises in the book seem to be more of a 'do this, do that, what is the result?' kind, which is great for getting into R, but makes our meetings a bit slow and dull (nice time for coffee drinking and chit chat, though). We are a mix of people, but all Ph.D. students and all with a background in cell-biology. Thanks in advance! Ulrik __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Bayesian question (problem using adapt)
In the following code I have created the posterior density for a Bayesian survival model with four parameters. However, when I try to use the adapt function to perform integration in four dimensions (on my old version of R I get an error message saying that I have applied a non-function, although the function does work when I type kernel2(param0, theta0), or on the newer version of R the computer crashes. I have attached the following R code: hazard1 - function(x, param) { if(min(x, param)=0) {return(function undefined)} return(param[1]*x^(param[2] -1)) } gm - function( theta, param) { dgamma(param[1], shape = .1, scale = .1) * dgamma(param[2], shape = .1, scale = .1) * dgamma(theta[1], shape = .1, scale = .1) * dgamma(theta[2], shape = .1, scale = .1) } chazard1 -function(x, param) { if(min(x, param) =0) {return(function undefined)} param[1]*x^param[2] / param[2] } hazard2 -function(x, theta, param) { if(min(x, theta, param) = 0) {return(function undefined)} ratio = 1/(theta[1]*exp(-chazard1(x, param)) + theta[2]*(1-exp(-chazard1(x, param return(ratio*hazard1(x, param)) } chazard2 - function(x, theta, param) { if(min(x, theta, param) =0) {return(function undefined)} val=c() for (i in 1:length(x)) { val=c(val, integrate(hazard2, lower=0, upper=x, theta=theta, param=param)$value)} return(val) } param0 = c(1.11, .833) theta0 = c(1.11, .833) yn1 -read.table(yang1.txt, col.names = c(trtmt, deathday, reason)) yn2 -read.table(yang2.txt, col.names = c(trtmt, deathday, reason)) for (i in 1:length(yn1$reason)) { if (yn1$reason[i] == -1) (yn1$reason[i] = 0) else (yn1$reason[i] = 1) } for (i in 1:length(yn2$reason)) { if (yn2$reason[i] == -1) (yn2$reason[i] = 0) else (yn2$reason[i] = 1) } x1 = yn1$deathday / (1*10^3); d1 = yn1$reason; x2 = yn2$deathday / (1* 10^3); d2 = yn2$reason; loglik - function( theta, param) { sum(d1*log(hazard1(x1, param)) - chazard1(x1, param) + d2*log(hazard2(x2, theta, param)) - chazard2(x2, theta, param))} / 1 kernel1 - function(theta, param) { exp(loglik(theta, param)) + log(1)} kernel2 - function(theta, param) {( exp(loglik(theta, param)) + log(1)) * gm(theta, param) } kernel2(theta0, param0) adapt(4, lower = c(0, 0, 0, 0), upper = c(1, 1, 1, 1), functn = kernel2(theta0, param0)) So I am trying to integrate the posterior density with four different parameters. But I cannot do anything to get the adapt function to work. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Comparison between GARCH and ARMA
Have you tried to Monte Carlo ARMA and GARCH? If you plot the resulting series in various ways, I suspect the differences will be apparent to you. If you'd like more from this list, I suggest you illustrate your question with commented, minimal, self-contained, reproducible code, as suggested in the posting guide www.R-project.org/posting-guide.html. Hope this helps. Spencer Graves [EMAIL PROTECTED] wrote: Hi i was just going by this thread, i thought of igniting my mind and got something wierd so i thought of making it wired. i think whether you take ARMA or GARCH. In computer science these are feedback systems or put it simply new values are function of past values. In ARMA case it is the return series and the error series. In case of GARCH it is the errors and stdev or returns and shock with propotionality of coeficient. In any case we are trying to find the returns only. What if i put stdev in ARMA and returns in GARCH ? I want to ask what it would end up showing me. For me both are having similar structure having two parts : 1. regression depending on past values 2. trying to reduce errors by averaging them i hope i am correct. please correct me where i am wrong. thanks and regards Email(Office) :- [EMAIL PROTECTED] , Email(Personal) :- [EMAIL PROTECTED] Wensui Liu [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 08-11-06 12:24 AM To Leeds, Mark (IED) [EMAIL PROTECTED] cc r-help@stat.math.ethz.ch, Megh Dal [EMAIL PROTECTED] Subject Re: [R] Comparison between GARCH and ARMA Mark, I totally agree that it doesn't make sense to compare arma with garch. but to some extent, garch can be considered arma for conditional variance. similarly, arch can be considered ma for conditional variance. the above is just my understanding, which might not be correct. thanks. On 11/7/06, Leeds, Mark (IED) [EMAIL PROTECTED] wrote: Hi : I'm a R novice but I consider myself reasonably versed in time series related material and I have never heard of an equivalence between Garch(1,1) for volatility and an ARMA(1,1) in the squared returns and I'm almost sure there isn't. There are various problems with what you wrote. 1) r(t) = h(t)*z(t) not h(i) but that's not a big deal. 2) you can't write the equation in terms of r(t) because r(t) = h(t)*z(t) and h(t) is UPDATED FIRST And then the relation r(t) = h(t)*z(t) is true ( in the sense of the model ). So, r(t) is a function of z(t) , a random variable, so trying to use r(t) on the left hand side of the volatility equation doesn't make sense at all. 3) even if your equation was valid, what you wrote is not an ARMA(1,1). The AR term is there but the MA term ( the beta term ) Has an r_t-1 terms in it when r_t-1 is on the left side. An MA term in an ARMA framework multiples lagged noise terms not the lag of what's on the left side. That's what the AR term does. 4) even if your equation was correct in terms of it being a true ARMA(1,1) , you Have common coefficients on The AR term and MA term ( beta ) so you would need contraints to tell the Model that this was the same term in both places. 5) basically, you can't do what you Are trying to do so you shouldn't expect to any consistency in estimates Of the intercept for the reasons stated above. why are you trying to transform in such a way anyway ? Now back to your original garch(1,1) model 6) a garch(1,1) has a stationarity condition that alpha + beta is less than 1 So this has to be satisfied when you estimate a garch(1,1). It looks like this condition is satisfied so you should be okay there. 7) also, if you are really assuming/believe that the returns have mean zero to begin with, without subtraction, Then you shouldn't be subtracting the mean before you estimate Because eseentially you will be subtracting noise and throwing out useful Information that could used in estimating the garch(1,1) parameters. Maybe you aren't assuming that the mean is zero and you are making the mean zero which is fine. I hope this helps you. I don't mean to be rude but I am just trying to get across that what you Are doing is not valid. If you saw the equivalence somewhere in the literature, Let me know because I would be interested in looking at it. mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Megh Dal Sent: Tuesday, November 07, 2006 2:24 AM To: r-help@stat.math.ethz.ch Subject: [R] Comparison between GARCH and ARMA Dear all R user, Please forgive me if my problem is too simple. Actually my problem is basically Statistical rather directly R related. Suppose I have return series ret with mean zero. And I want to fit a Garch(1,1) on this. my is r[t] = h[i]*z[t] h[t] = w + alpha*r[t-1]^2 + beta*h[t-1] I want to estimate the three parameters here; the R syntax is as follows: # download data:
Re: [R] Problems with plot and X11 in ubuntu
Take a look at this link: http://www.ubuntuforums.org/showthread.php?t=268024 HTH Oscar On Nov 11, 2006, at 04:19, Bagatti Davide wrote: About Ubuntu, it's a new installation (ubuntu 6.10, code name Edgy Eft). About R, it's a new installation. Thank you very much 2006/11/10, [EMAIL PROTECTED] [EMAIL PROTECTED]: A few questions before I may help. Is this a NEW installation or an upgrade? If an upgrade, what version are you upgrading from? Regards, Oscar From: Bagatti Davide [EMAIL PROTECTED] Date: 2006/11/10 Fri AM 09:22:24 CST To: r-help@stat.math.ethz.ch Subject: [R] Problems with plot and X11 in ubuntu Hello, I am an italian student, who is trying to use R 2.3.1 with Ubuntu 6.10 (last version). When I try to use the plot command, I get the error: could not find any X11 fonts Check that the Font Path is correct How can I solve this problem? Thank you very much Davide [[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 and provide commented, minimal, self-contained, reproducible code. [[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 and provide commented, minimal, self-contained, reproducible code.
[R] R Help
Respected Sir I request you to please fill the following read.table function and read.csvfor my understanding by assuming my data attached with this maiL, because I am fail to run these functions using manual guidlines. read.table(file, header = FALSE, sep = , quote = \', dec = ., row.names, col.names, as.is = !stringsAsFactors, na.strings = NA, colClasses = NA, nrows = -1, skip = 0, check.names = TRUE, fill = !blank.lines.skip, strip.white = FALSE, blank.lines.skip = TRUE, comment.char = #, allowEscapes = FALSE, flush = FALSE, stringsAsFactors = default.stringsAsFactors()) read.csv(file, header = TRUE, sep = ,, quote=\, dec=., fill = TRUE, comment.char=, ...) read.delim(file, header = TRUE, sep = \t, quote=\, dec=., fill = TRUE, comment.char=, ...) I shall be really thankful to you. REGARDS -- AMINA SHAHZADI Department of Statistics GC University Lahore, Pakistan. Email: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] Years lrmax n1 n2 n3 n4 arranged 1980207.6 25 24 23 22 29.4 198192.724 23 22 21 49.4 198267.523 22 21 20 55.1 198393.822 21 20 19 58 198460.621 20 19 18 59 1985117.4 20 19 18 17 59.1 198665.319 18 17 16 60.6 198759.118 17 16 15 65.3 198876.917 16 15 14 67.5 1989123.1 16 15 14 13 69.6 199083.115 14 13 12 75.7 199175.714 13 12 11 76.8 199269.613 12 11 10 76.9 199355.112 11 10 9 83.1 199449.411 10 9 8 84.2 199576.810 9 8 7 87 1996189.7 9 8 7 6 88.2 1997151.1 8 7 6 5 92.7 199859 7 6 5 4 93.8 199988.26 5 4 3 110 2000110 5 4 3 2 117.4 200187 4 3 2 1 123.1 200229.43 2 1 0 136.8 200384.22 1 0 0 151.1 200458 1 0 0 0 189.7 2005136.8 0 0 0 0 207.6 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R Help
d - read.table(lahore.txt, header=TRUE) On 11/11/06, amna khan [EMAIL PROTECTED] wrote: Respected Sir I request you to please fill the following read.table function and read.csvfor my understanding by assuming my data attached with this maiL, because I am fail to run these functions using manual guidlines. read.table(file, header = FALSE, sep = , quote = \', dec = ., row.names, col.names, as.is = !stringsAsFactors, na.strings = NA, colClasses = NA, nrows = -1, skip = 0, check.names = TRUE, fill = !blank.lines.skip, strip.white = FALSE, blank.lines.skip = TRUE, comment.char = #, allowEscapes = FALSE, flush = FALSE, stringsAsFactors = default.stringsAsFactors()) read.csv(file, header = TRUE, sep = ,, quote=\, dec=., fill = TRUE, comment.char=, ...) read.delim(file, header = TRUE, sep = \t, quote=\, dec=., fill = TRUE, comment.char=, ...) I shall be really thankful to you. REGARDS -- AMINA SHAHZADI Department of Statistics GC University Lahore, Pakistan. Email: [EMAIL PROTECTED] [EMAIL PROTECTED] [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 and provide commented, minimal, self-contained, reproducible code. -- = David Barron Said Business School University of Oxford Park End Street Oxford OX1 1HP __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R Help
data = read.delim(lahore.txt) is enough for what you want to do. b On Nov 11, 2006, at 2:11 PM, amna khan wrote: Respected Sir I request you to please fill the following read.table function and read.csvfor my understanding by assuming my data attached with this maiL, because I am fail to run these functions using manual guidlines. read.table(file, header = FALSE, sep = , quote = \', dec = ., row.names, col.names, as.is = !stringsAsFactors, na.strings = NA, colClasses = NA, nrows = -1, skip = 0, check.names = TRUE, fill = !blank.lines.skip, strip.white = FALSE, blank.lines.skip = TRUE, comment.char = #, allowEscapes = FALSE, flush = FALSE, stringsAsFactors = default.stringsAsFactors()) read.csv(file, header = TRUE, sep = ,, quote=\, dec=., fill = TRUE, comment.char=, ...) read.delim(file, header = TRUE, sep = \t, quote=\, dec=., fill = TRUE, comment.char=, ...) I shall be really thankful to you. REGARDS -- AMINA SHAHZADI Department of Statistics GC University Lahore, Pakistan. Email: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] lahore.txt __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting- guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R Help
Not sure of what you ask... Does it help? $ read.table(Desktop/lahore.txt, header=T) Years lrmax n1 n2 n3 n4 arranged 1 1980 207.6 25 24 23 22 29.4 2 1981 92.7 24 23 22 21 49.4 3 1982 67.5 23 22 21 20 55.1 4 1983 93.8 22 21 20 19 58.0 5 1984 60.6 21 20 19 18 59.0 6 1985 117.4 20 19 18 17 59.1 7 1986 65.3 19 18 17 16 60.6 8 1987 59.1 18 17 16 15 65.3 9 1988 76.9 17 16 15 14 67.5 10 1989 123.1 16 15 14 13 69.6 11 1990 83.1 15 14 13 12 75.7 12 1991 75.7 14 13 12 11 76.8 13 1992 69.6 13 12 11 10 76.9 14 1993 55.1 12 11 10 9 83.1 15 1994 49.4 11 10 9 8 84.2 16 1995 76.8 10 9 8 7 87.0 17 1996 189.7 9 8 7 6 88.2 18 1997 151.1 8 7 6 5 92.7 19 1998 59.0 7 6 5 4 93.8 20 1999 88.2 6 5 4 3110.0 21 2000 110.0 5 4 3 2117.4 22 2001 87.0 4 3 2 1123.1 23 2002 29.4 3 2 1 0136.8 24 2003 84.2 2 1 0 0151.1 25 2004 58.0 1 0 0 0189.7 26 2005 136.8 0 0 0 0207.6 Le Samedi 11 Novembre 2006 20:11, amna khan a écrit : Respected Sir I request you to please fill the following read.table function and read.csvfor my understanding by assuming my data attached with this maiL, because I am fail to run these functions using manual guidlines. read.table(file, header = FALSE, sep = , quote = \', dec = ., row.names, col.names, as.is = !stringsAsFactors, na.strings = NA, colClasses = NA, nrows = -1, skip = 0, check.names = TRUE, fill = !blank.lines.skip, strip.white = FALSE, blank.lines.skip = TRUE, comment.char = #, allowEscapes = FALSE, flush = FALSE, stringsAsFactors = default.stringsAsFactors()) read.csv(file, header = TRUE, sep = ,, quote=\, dec=., fill = TRUE, comment.char=, ...) read.delim(file, header = TRUE, sep = \t, quote=\, dec=., fill = TRUE, comment.char=, ...) I shall be really thankful to you. REGARDS -- Nicolas Mazziotta __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R Help
If you were trying to use the sep=\t argument, you might have encountered an error, as there are three tabs one of the two blank lines at the end of your data file. The default for read.table and read.delim (as has been suggested by David and Benilton) is whitespace, which consumes the unintended tabs w/o problem. Jeff. On Nov 11, 2006, at 2:31 PM, Benilton Carvalho wrote: data = read.delim(lahore.txt) is enough for what you want to do. b On Nov 11, 2006, at 2:11 PM, amna khan wrote: Respected Sir I request you to please fill the following read.table function and read.csvfor my understanding by assuming my data attached with this maiL, because I am fail to run these functions using manual guidlines. read.table(file, header = FALSE, sep = , quote = \', dec = ., row.names, col.names, as.is = !stringsAsFactors, na.strings = NA, colClasses = NA, nrows = -1, skip = 0, check.names = TRUE, fill = !blank.lines.skip, strip.white = FALSE, blank.lines.skip = TRUE, comment.char = #, allowEscapes = FALSE, flush = FALSE, stringsAsFactors = default.stringsAsFactors()) read.csv(file, header = TRUE, sep = ,, quote=\, dec=., fill = TRUE, comment.char=, ...) read.delim(file, header = TRUE, sep = \t, quote=\, dec=., fill = TRUE, comment.char=, ...) I shall be really thankful to you. REGARDS -- AMINA SHAHZADI Department of Statistics GC University Lahore, Pakistan. Email: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] lahore.txt __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting- guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting- guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Install bioconductor
Hello useRs, I'm trying to install bioconductor on ubuntu edgy eft and R 2.4.0. I have some error messages during installation, in particular for the package affy : Error: package 'affy' required by 'makecdfenv' could not be found I have tryed to install 'makecdfenv' with the command : getBioC(makecdfenv) But I have this message : Running getBioC version 0.1.8 with R version 2.4.0 Running biocinstall version 1.9.9 with R version 2.4.0 Your version of R requires version 1.9 of Bioconductor. Avis dans install.packages(pkgs = pkgs, repos = repos, dependencies = dependencies, : argument 'lib' is missing: using /usr/local/lib/R/site-library also installing the dependencies 'affy', 'affyio' essai de l'URL ' http://bioconductor.org/packages/1.9/bioc/src/contrib/affy_1.12.1.tar.gz' Content type 'application/x-gzip' length 1370295 bytes URL ouverte == downloaded 1338Kb essai de l'URL ' http://bioconductor.org/packages/1.9/bioc/src/contrib/affyio_1.2.0.tar.gz' Content type 'application/x-gzip' length 57410 bytes URL ouverte == downloaded 56Kb essai de l'URL ' http://bioconductor.org/packages/1.9/bioc/src/contrib/makecdfenv_1.12.0.tar.gz ' Content type 'application/x-gzip' length 3222836 bytes URL ouverte == downloaded 3147Kb * Installing *source* package 'affyio' ... creating cache ./config.cache checking how to run the C preprocessor... cc -E checking for main in -lz... no updating cache ./config.cache creating ./config.status creating src/Makevars ** libs gcc -I/usr/share/R/include -I/usr/share/R/include -fpic -g -O2 -std=gnu99 -c read_abatch.c -o read_abatch.o read_abatch.c:151:18: error: zlib.h: Aucun fichier ou répertoire de ce type read_abatch.c:1244: error: expected declaration specifiers or '...' before 'gzFile' read_abatch.c: In function 'ReadgzFileLine': read_abatch.c:1245: warning: implicit declaration of function 'gzgets' read_abatch.c:1245: error: 'currentFile' undeclared (first use in this function) read_abatch.c:1245: error: (Each undeclared identifier is reported only once read_abatch.c:1245: error: for each function it appears in.) read_abatch.c:1245: warning: comparison between pointer and integer read_abatch.c: At top level: read_abatch.c:1265: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'open_gz_cel_file' read_abatch.c:1306: error: expected ')' before 'my_file' read_abatch.c:1329: error: expected ')' before 'my_file' read_abatch.c: In function 'check_gzcel_file': read_abatch.c:1360: error: 'gzFile' undeclared (first use in this function) read_abatch.c:1360: error: expected ';' before 'currentFile' read_abatch.c:1364: error: 'currentFile' undeclared (first use in this function) read_abatch.c:1364: warning: implicit declaration of function 'open_gz_cel_file' read_abatch.c:1367: warning: implicit declaration of function 'gzAdvanceToSection' read_abatch.c:1368: warning: implicit declaration of function 'gzfindStartsWith' read_abatch.c:1393: warning: implicit declaration of function 'gzclose' read_abatch.c: In function 'read_gzcel_file_intensities': read_abatch.c:1421: error: 'gzFile' undeclared (first use in this function) read_abatch.c:1421: error: expected ';' before 'currentFile' read_abatch.c:1426: error: 'currentFile' undeclared (first use in this function) read_abatch.c:1432: error: too many arguments to function 'ReadgzFileLine' read_abatch.c: In function 'read_gzcel_file_stddev': read_abatch.c:1495: error: 'gzFile' undeclared (first use in this function) read_abatch.c:1495: error: expected ';' before 'currentFile' read_abatch.c:1500: error: 'currentFile' undeclared (first use in this function) read_abatch.c:1506: error: too many arguments to function 'ReadgzFileLine' read_abatch.c: In function 'read_gzcel_file_npixels': read_abatch.c:1579: error: 'gzFile' undeclared (first use in this function) read_abatch.c:1579: error: expected ';' before 'currentFile' read_abatch.c:1584: error: 'currentFile' undeclared (first use in this function) read_abatch.c:1590: error: too many arguments to function 'ReadgzFileLine' read_abatch.c: In function 'gz_apply_masks': read_abatch.c:1669: error: 'gzFile' undeclared (first use in this function) read_abatch.c:1669: error: expected ';' before 'currentFile' read_abatch.c:1678: error: 'currentFile' undeclared (first use in this function) read_abatch.c:1691: error: too many arguments to function 'ReadgzFileLine' read_abatch.c:1715: error: too many arguments to function 'ReadgzFileLine' read_abatch.c: In function 'gz_get_header_info': read_abatch.c:1749: error: 'gzFile' undeclared (first use in this function) read_abatch.c:1749: error: expected ';' before 'currentFile' read_abatch.c:1753: error: 'currentFile' undeclared (first use in this function) read_abatch.c: In function 'gz_get_detailed_header_info': read_abatch.c:1807: error: 'gzFile' undeclared (first use in this function)
Re: [R] Which genetic optimization package allows customized crossover and mutation operation
Hi Dirk, Thanks for the reply. I have some GA code in java actually, but failed to install the SJava package in windows XP, really frustratting experience, do not understand why no binary distribution available. Now I am trying to finish my current work purely in java except some data exchange with R via files:(. I use a fake email address in outlookexpress to prevent spam actually, (have already discard some email addresses for that reason). and .. Sun is my real name;) have a nice day. Sun - 原始邮件 发件人: Dirk Eddelbuettel [EMAIL PROTECTED] 收件人: sun [EMAIL PROTECTED] 抄送: r-help@stat.math.ethz.ch 已发送: 2006/11/10(周五), 下午5:08:45 主题: Re: [R] Which genetic optimization package allows customized crossover and mutation operation On 10 November 2006 at 16:19, sun wrote: | No, I am not familiar with that project, actually never heard it before your | reply.:) | | Anyway, I found some code later on from Claudio Agostinelli who developed | this code for his teaching, I think. Unfortornuitly, his code does not work | on my settings. And I do not want to send much time on the object oriented | programing skill in R, so finally I went back to java for this GA work. FWIW I did some recent work with the 'pgapack' C++ library, but I have no R package for show for that. Also, mail to your address bounces and you are not posting with a real name. Both practices are frowned upon, so you may get fewer helpful replies than you could otherwise expect. Cheers, Dirk -- Hell, there are no rules here - we're trying to accomplish something. -- Thomas A. Edison R-help@stat.math.ethz.ch mailing list PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ___ 抢注雅虎免费邮箱-3.5G容量,20M附件! __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Install bioconductor
You are missing both the library and headers for what would be called either zlib or libz. (On an RPM-based system it would be zlib-devel that is missing.) However, this is the wrong list for questions anout installing BioC packages: please see the R posting guide. (And probably the packages should check for the headers like zlib.h as well as for -lz, something which is best discussed on the BioC list.) On Sat, 11 Nov 2006, David Hajage wrote: Hello useRs, I'm trying to install bioconductor on ubuntu edgy eft and R 2.4.0. I have some error messages during installation, in particular for the package affy : Error: package 'affy' required by 'makecdfenv' could not be found I have tryed to install 'makecdfenv' with the command : getBioC(makecdfenv) But I have this message : Running getBioC version 0.1.8 with R version 2.4.0 Running biocinstall version 1.9.9 with R version 2.4.0 Your version of R requires version 1.9 of Bioconductor. Avis dans install.packages(pkgs = pkgs, repos = repos, dependencies = dependencies, : argument 'lib' is missing: using /usr/local/lib/R/site-library also installing the dependencies 'affy', 'affyio' essai de l'URL ' http://bioconductor.org/packages/1.9/bioc/src/contrib/affy_1.12.1.tar.gz' Content type 'application/x-gzip' length 1370295 bytes URL ouverte == downloaded 1338Kb essai de l'URL ' http://bioconductor.org/packages/1.9/bioc/src/contrib/affyio_1.2.0.tar.gz' Content type 'application/x-gzip' length 57410 bytes URL ouverte == downloaded 56Kb essai de l'URL ' http://bioconductor.org/packages/1.9/bioc/src/contrib/makecdfenv_1.12.0.tar.gz ' Content type 'application/x-gzip' length 3222836 bytes URL ouverte == downloaded 3147Kb * Installing *source* package 'affyio' ... creating cache ./config.cache checking how to run the C preprocessor... cc -E checking for main in -lz... no [etc] -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Fitting a survival curve
I am new to R and am trying to fit a survival curve with a weibull hazard function to a set of data giving the probability of survival to age x, given the year of birth, in the form: Probability of survival: Birth year 19801981... 2003 .2 0.900.89... 0.87 1 0.800.81... 0.79 age 2 0.750.74... 0.73 3 0.700.69... 0.68 5 0.500.49... 0.43 10 0.300.31... 0.26 I would like to be able to fit a curve to each birth cohort, extrapolate the curve a few years and be able to create a plot of the survival curves. Am having some trouble with working out how to do this in R and would be most grateful for a few pointers. Many thanks for any help Rich __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Problems with plot and X11 in ubuntu
Hi Everyone, Thanks for the question and the answer. It helped me solve the problem which I too faced. Ritwik. On 11/11/06, Oscar [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Take a look at this link: http://www.ubuntuforums.org/showthread.php?t=268024 HTH Oscar On Nov 11, 2006, at 04:19, Bagatti Davide wrote: About Ubuntu, it's a new installation (ubuntu 6.10, code name Edgy Eft). About R, it's a new installation. Thank you very much 2006/11/10, [EMAIL PROTECTED] [EMAIL PROTECTED]: A few questions before I may help. Is this a NEW installation or an upgrade? If an upgrade, what version are you upgrading from? Regards, Oscar From: Bagatti Davide [EMAIL PROTECTED] Date: 2006/11/10 Fri AM 09:22:24 CST To: r-help@stat.math.ethz.ch Subject: [R] Problems with plot and X11 in ubuntu Hello, I am an italian student, who is trying to use R 2.3.1 with Ubuntu 6.10 (last version). When I try to use the plot command, I get the error: could not find any X11 fonts Check that the Font Path is correct How can I solve this problem? Thank you very much Davide [[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 and provide commented, minimal, self-contained, reproducible code. [[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 and provide commented, minimal, self-contained, reproducible code. -- Ritwik Sinha Graduate Student Epidemiology and Biostatistics Case Western Reserve University [EMAIL PROTECTED] | +12163682366 | http://darwin.cwru.edu/~rsinha __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] forward variable selection using function step
Hello, I met this problem with the function step( ) when I was trying to do forward variable selection. Below is the code I used and the error message. I don't why I am getting this error message. Could someone help me out. I noticed that I got this error message whenever it chose a model with an interaction term X_p :X_q and if I put X_q before X_p in the upper scope formula, like X_q*X_p***. Shouldn't X_p:X_q be the same as X_q:X_p? So why am I getting this error message? Any help is greatly appreciated. x1-rnorm(100,0,1) x2-rnorm(100,0,1) x3-rnorm(100,0,1) y-x1+x2+2*x3+2*x1*x3+rnorm(100,0,1) datasim-data.frame(cbind(y,x1,x2,x3)) steplm-step(lm(y~1,data=datasim),scope=list(upper=~x1*x2*x3,lower=~1),direction=forward,trace=1) Start: AIC= 274.81 y ~ 1 Df Sum of Sq RSS AIC + x31615.97 914.34 225.30 + x11139.97 1390.34 267.21 + x21 83.42 1446.90 271.20 none 1530.32 274.81 Step: AIC= 225.3 y ~ x3 Df Sum of SqRSSAIC + x11184.94 729.40 204.71 + x21 53.87 860.48 221.23 none 914.34 225.30 Step: AIC= 204.71 y ~ x3 + x1 Df Sum of SqRSSAIC + x1:x3 1533.91 195.49 75.03 + x2 1 47.44 681.96 199.98 none 729.40 204.71 Step: AIC= 75.03 y ~ x3 + x1 + x3:x1 Error in factor.scope(ffac, list(add = fadd, drop = fdrop)) : upper scope does not include model Thanks, Min [[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 and provide commented, minimal, self-contained, reproducible code.
[R] Unexpected behavior in boxplot
When plotting using the cex.axis argument to boxplot(), the size of the plotting symbols beyond the whiskers of the boxplot are being changes. Example: par(mfrow=c(2,1)) boxplot(c(rnorm(10), 10), horizontal=TRUE, main=Test, las=2, cex.axis=2) boxplot(c(rnorm(10), 10), horizontal=TRUE, main=Test, las=2, cex.axis=1) This is from the following line in bxp() outcex - pcycle(pars$outcex, pars$cex, par(cex)) Where pars$cex is matching pars$cex.axis. This would also effect other parameter specifications. This is a behavior I did not expect; I'm not sure if this is a design feature or something else. --Matt Matt Austin Statistician Amgen, Inc 800 9AMGEN9 x77431 805-447-7431 The purpose of computing is insight, not numbers --Richard Hamming [[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 and provide commented, minimal, self-contained, reproducible code.
Re: [R] Unexpected behavior in boxplot
Apologies for the html mail, my company just upgraded and I forgot to change the default mail behavior. Version information that I also forgot: version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 4.0 year 2006 month 10 day03 svn rev39566 language R version.string R version 2.4.0 (2006-10-03) --Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Austin, Matt Sent: Saturday, November 11, 2006 8:15 PM To: r-help@stat.math.ethz.ch Subject: [R] Unexpected behavior in boxplot When plotting using the cex.axis argument to boxplot(), the size of the plotting symbols beyond the whiskers of the boxplot are being changes. Example: par(mfrow=c(2,1)) boxplot(c(rnorm(10), 10), horizontal=TRUE, main=Test, las=2, cex.axis=2) boxplot(c(rnorm(10), 10), horizontal=TRUE, main=Test, las=2, cex.axis=1) This is from the following line in bxp() outcex - pcycle(pars$outcex, pars$cex, par(cex)) Where pars$cex is matching pars$cex.axis. This would also effect other parameter specifications. This is a behavior I did not expect; I'm not sure if this is a design feature or something else. --Matt Matt Austin Statistician Amgen, Inc 800 9AMGEN9 x77431 805-447-7431 The purpose of computing is insight, not numbers --Richard Hamming [[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 and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Bayesian question (problem using adapt)
On Sat, Nov 11, 2006 at 11:19:46AM -0500, [EMAIL PROTECTED] wrote: kernel1 - function(theta, param) { exp(loglik(theta, param)) + log(1)} kernel2 - function(theta, param) {( exp(loglik(theta, param)) + log(1)) * gm(theta, param) } kernel2(theta0, param0) adapt(4, lower = c(0, 0, 0, 0), upper = c(1, 1, 1, 1), functn = kernel2(theta0, param0)) I could not walk through your code because you failed to create a simple reproducible example (eg the data is missing), but kernel2(theta0,param0) is no longer a function --- kernel2 is, you need to just supply that. A couple of remarks: - instead of function undefined, you might just want to return NA or NaN as is standard in R. - why do you multiply by 1? - are you just integrating the posterior? why? - have you considered MCMC? On state spaces bigger than 2 dimension, it is usually preferable to numerical integration (but since I don't know your model in detail, there might be something special about it). Best, Tamas __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.