[R] Programmatically give file name to a matrix

2013-01-30 Thread Kumar Mainali
I have a situation when I need to save matrix with file names that are programmatically created. for (i in levels(mergeTrn$Continent)) { matrix here # I want to save this matrix with a file name that carries i from for loop. The following does not work. paste(plotroc_GBM_Trn_, i,

[R] Add axes to a 3D scene (afer makeTriangles)

2013-01-30 Thread cgenolin
Hi all, I am drawing some 3D surfaces using the Triangle tools (package misc3) and drawScene.rgl. Do you know if it is possible to add axes and graduation on the scene? Christophe -- View this message in context:

Re: [R] Programmatically give file name to a matrix

2013-01-30 Thread Pascal Oettli
Hello, ?assign assign(paste(plotroc_GBM_Trn_, i, sep=), matrix(rnorm(100),10,10)) HTH, Pascal Le 30/01/2013 17:04, Kumar Mainali a écrit : I have a situation when I need to save matrix with file names that are programmatically created. for (i in levels(mergeTrn$Continent)) {

Re: [R] Creating dummy variables in r

2013-01-30 Thread peter dalgaard
On Jan 30, 2013, at 04:58 , Bert Gunter wrote: You almost never need dummy variables in R. R creates them automatically from factors given model and possibly contrasts specification. ?contrasts ## for some technical details. If you have not read An Introduction to R do so now. Pay

Re: [R] problem wih plotrix:cluster.overplot

2013-01-30 Thread Jim Lemon
On 01/29/2013 06:53 PM, Jean Véronis wrote: Hello, I am trying to use cluster.overplot from package plotrix and I get an error message when I add the away parameter: require(plotrix) distance- read.table(distance.txt) cmd- cmdscale(distance) cp- cluster.overplot(cmd, away=2) Error in if

[R] Relative Risk in logistic regression

2013-01-30 Thread aminreza Aamini
Hi all, I am very grateful to all those who write to me 1) how i can obtain relative risk (risk ratio) in logistic regression in R. 2) how to obtain the predicted risk for a certain individual using fitted regression model in R. Many thanks, in advance, for your help. Amin.

[R] Arima model estimated by Maximum likelihood conditional on a zero initial residual

2013-01-30 Thread ghjf fghjk
Hello, I would like to estimate Arima model by Maximum likelihood conditional on a zero initial residual. I am using: model - arima(y[1:N], order=c(1, 0, 1), method=ML, include.mean=TRUE) model What I have to use to estimate arima model by Maximum likelihood conditional on a zero initial

[R] substring from behind

2013-01-30 Thread Mat
Hello together, i have a question for substring. I know i can filter a number like this one: bill$No-substring(bill$Customer,2,4) in this case i get the 2nd, 3rd and 4th number of my Customer ID. But how can i do this, if i want the 2nd, 3rd and 4th number of a column. Like this one. I have:

Re: [R] problem wih plotrix:cluster.overplot

2013-01-30 Thread Jean Véronis
great! many thanks! Le 30 janv. 2013 à 09:52, Jim Lemon j...@bitwrit.com.au a écrit : On 01/29/2013 06:53 PM, Jean Véronis wrote: Hello, I am trying to use cluster.overplot from package plotrix and I get an error message when I add the away parameter: require(plotrix) distance-

Re: [R] substring from behind

2013-01-30 Thread Jorge I Velez
Hi Mat, The following should get you started: s - Mercedes_02352 substr(s, nchar(s) - 3, nchar(s) - 1) [1] 235 # defining a function foo - function(x, a = 3, b = 1) substr(s, nchar(x) - a, nchar(x) - b) foo(s) [1] 235 HTH, Jorge.- On Wed, Jan 30, 2013 at 8:05 PM, Mat wrote: Hello

[R] recoding variables again :(

2013-01-30 Thread David Studer
Hello everybody! I have again a rather simple question concerning recoding of variables: I have a variable/data-frame column BIRTHPLACE containing abbreviations of the 26 swiss counties (AG, AI, AR, BE, ZH, ... ) as well as international country codes (USA, GER, ESP, etc.) and another variable

Re: [R] recoding variables again :(

2013-01-30 Thread Jorge I Velez
Hi David, Check ?%in% for a simpler approach. Regards, Jorge.- On Wed, Jan 30, 2013 at 8:42 PM, David Studer wrote: Hello everybody! I have again a rather simple question concerning recoding of variables: I have a variable/data-frame column BIRTHPLACE containing abbreviations of the

[R] Fwd:

2013-01-30 Thread CALEF ALEJANDRO
http://www.consultadifesapdl.it/6cmpqy.php __ R-help@r-project.org 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,

[R] Relative Risk in logistic regression

2013-01-30 Thread aminreza Aamini
Hi all, I am very grateful to all those who write to me 1) how i can obtain relative risk (risk ratio) in logistic regression in R. 2) how to obtain the predicted risk for a certain individual using fitted regression model in R. Many thanks, in advance, for your help. Amin.

Re: [R] Netcdf and Raster Package Questions, Need .asc File for GIS

2013-01-30 Thread Roger Bivand
Douglas M. Hultstrand dmhultst at metstat.com writes: Hello R-Group, I am new working with netcdf files and the raster package in R.I am trying to read in a netcdf file using the package ncdf.I am able to get the lat, lon and parameter I need and can plot using fill.contour. Please

Re: [R] recoding variables again :(

2013-01-30 Thread arun
Hi, set.seed(125) dat1-data.frame(BIRTHPLACE=sample(c(AG,AI,AR,BE,ZH,USA,GER,ESP),20,replace=TRUE),RES_STA=sample(LETTERS[c(1:3,24:25)],20,replace=TRUE)) dat1$VARNEW-ifelse(dat1$RES_STA==X dat1$BIRTHPLACE%in%c(AG,AI,AR,BE,ZH),swiss,unknown) A.K. - Original Message - From: David

Re: [R] I think you misunderstood my explantation.

2013-01-30 Thread arun
Hi, Your dataset had already some missing values.  So, I need to subset only those rows that are not missing. !is.na(temp$ACTIVE_KWH) # [1]  TRUE  TRUE  TRUE FALSE  TRUE FALSE FALSE  TRUE  TRUE  TRUE  TRUE FALSE #[13]  TRUE  TRUE  TRUE temp$ACTIVE_KWH[!is.na(temp$ACTIVE_KWH)] #[1] 1201.9 1202.2

Re: [R] Fastest way to compare a single value with all values in one column of a data frame

2013-01-30 Thread nalluri pratap
Hi Dimitri,   Does this help?   k1-data.frame(item=sample(rep(letters),10,replace=T),a=c(1:10),b=11:20) k2-data.frame(item=f,a=3,b=10) merge-function(y,x) { if(y$amin(x$a)) {   x-rbind(x,y)   x-x[-which.min(x$a),] } return(x) } merge(k2,k1)   or much faster way would be to refer library(sqldf).

Re: [R] Integration of mixed normal distribution

2013-01-30 Thread Rui Barradas
Hello, You could do something like the following. fun - function(x, mean, sd1, sd2, p) dnorm(x, mean, sd1)*p + dnorm(x, mean, sd2)*(1 - p) fun2 - function(x1, x2, mean, sd1, sd2, p){ p1 - pnorm(x2, mean, sd1) - pnorm(x1, mean, sd1) p2 - pnorm(x2, mean, sd2) - pnorm(x1,

Re: [R] Fastest way to compare a single value with all values in one column of a data frame

2013-01-30 Thread Jessica Streicher
If you wanted this for all values in x that are smaller, i'd use x[x$a y$a,] - y for just the smallest: x[intersect(which(x$a y$a),which.min(x$a)),] - y On 29.01.2013, at 22:11, Dimitri Liakhovitski wrote: Hello! I have a large data frame x:

Re: [R] Sweave files generating miktex errors

2013-01-30 Thread Duncan Murdoch
On 13-01-29 6:04 PM, Troy S wrote: Ok, yes I realize it. So let me try to fix it: I removed the sty files, and set TEXINPUTS to 'C:\R\R-2.15.2\share\texmf\tex\latex I am back where I started: the tex file will not process. Please let me know what I should do to fix the issue. Follow my

Re: [R] rpart

2013-01-30 Thread Adams, Jean
Carol, Actually, you have only five nodes, numbered 1, 2, 3, 6, and 7. And all five nodes are included in your plot. Nodes 1 and 3 are branching nodes; nodes 2, 6, and 7 are terminal nodes. Try typing just the name of the rpart object for a very brief text version of the tree. rpart.res

[R] remove label from specific axis

2013-01-30 Thread e-letter
Readers, For a graph plot instruction: plot(seq(10:50),type='h',yaxt='n',yaxs='i',lab=c(20,2,2),xlab='x axis label',bty='l',main='graph title') how to remove y-axis label and keep the x-axis label? _ r2151 __ R-help@r-project.org mailing list

Re: [R] remove label from specific axis

2013-01-30 Thread Rui Barradas
Hello, Just use ylab = . Hope this helps, Rui Barradas Em 30-01-2013 13:33, e-letter escreveu: Readers, For a graph plot instruction: plot(seq(10:50),type='h',yaxt='n',yaxs='i',lab=c(20,2,2),xlab='x axis label',bty='l',main='graph title') how to remove y-axis label and keep the x-axis

Re: [R] recoding variables again :(

2013-01-30 Thread nalluri pratap
dat1$VARNEW-rep(unknown,nrow(dat1)) dat1$VARNEW[dat1$RES_STA==X dat1$BIRTHPLACE %in% c(AG,AI,AR,BE,ZH)]-swiss --- On Wed, 30/1/13, arun smartpink...@yahoo.com wrote: From: arun smartpink...@yahoo.com Subject: Re: [R] recoding variables again :( To: stude...@gmail.com stude...@gmail.com Cc: R

Re: [R] Sweave files generating miktex errors

2013-01-30 Thread Michael Friendly
On 1/29/2013 6:04 PM, Troy S wrote: Ok, yes I realize it. So let me try to fix it: I removed the sty files, and set TEXINPUTS to 'C:\R\R-2.15.2\share\texmf\tex\latex I am back where I started: the tex file will not process. Please let me know what I should do to fix the issue. Troy Don't do

Re: [R] Relative Risk in logistic regression

2013-01-30 Thread nalluri pratap
Relative risk = exp(coef(model)) --- On Wed, 30/1/13, aminreza Aamini amin.r@gmail.com wrote: From: aminreza Aamini amin.r@gmail.com Subject: [R] Relative Risk in logistic regression To: R-help R-help@r-project.org Date: Wednesday, 30 January, 2013, 4:19 PM Hi all, I am very grateful

Re: [R] Sweave files generating miktex errors

2013-01-30 Thread Duncan Murdoch
On 13-01-30 8:52 AM, Michael Friendly wrote: On 1/29/2013 6:04 PM, Troy S wrote: Ok, yes I realize it. So let me try to fix it: I removed the sty files, and set TEXINPUTS to 'C:\R\R-2.15.2\share\texmf\tex\latex I am back where I started: the tex file will not process. Please let me know what

Re: [R] Fastest way to compare a single value with all values in one column of a data frame

2013-01-30 Thread arun
Hi, I guess you could also use:  x[match(min(x$a),x$a[x$ay$a]),]- y  x #  item a  b #1    f 3 10 #2    b 2 12 #3    c 3 13 #4    d 4 14 #5    e 5 15 A.K. - Original Message - From: Dimitri Liakhovitski dimitri.liakhovit...@gmail.com To: r-help r-help@r-project.org Cc: Sent: Tuesday,

Re: [R] Relative Risk in logistic regression

2013-01-30 Thread nalluri pratap
Example from linear regression help (?lm)   ctl - c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt - c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group - gl(2,10,20, labels=c(Ctl,Trt)) weight - c(ctl, trt) lm.D9 - lm(weight ~ group) lm.D90 - lm(weight ~ group - 1)  

Re: [R] substring from behind

2013-01-30 Thread arun
Hi, You could use: dat1-data.frame(col1=c(Mercedes_02352,Audi_03555)) dat1[,1]-as.numeric(gsub(.*_\\d{1}(.*)\\d{1}$,\\1,dat1[,1])) #if the number of digits are the same  dat1 #  col1 #1  235 #2  355 A.K. - Original Message - From: Mat matthias.we...@fnt.de To: r-help@r-project.org Cc:

[R] temporal correlogram

2013-01-30 Thread Valerie Lehouck
Hi all, I’ve just started to learn working with R. I wonder if it is possible to make a ‘temporal correlogram’ in R and how to do it. Actually what I have are movement tracks of birds, existing as XY-positions every 5 minutes for a duration of at least 60 minutes (but up to 8 hours). From these

[R] (no subject)

2013-01-30 Thread Meenakshi Shankar Santhakumar
Dear Team, I am getting the following error message when try to run vb application The program was running fine in 32 windows 7 machine. When i moved the same program to 64 bit windows 8 machine i am getting the following error Error in inDL(x, as.logical(local), as.logical(now), ...) : unable

[R] Percentages in bar plot

2013-01-30 Thread Naser Jamil
Dear R-users, Though it's a silly thing to ask, but I'm not getting a way out. I wish to find the percentage distribution for a data vector 'stop'. The coomand below is giving the frequency distribution. May I know the option to see the percentages instead of frequencies. Similarly, what option

Re: [R] substring from behind

2013-01-30 Thread Isidro Hidalgo
It's possible the direct way in R: customer - c(Mercedes_02352, Audi_03555) substr(customer, nchar(customer) - 3, nchar(customer) - 1) Isidro -Mensaje original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] En nombre de Jorge I Velez Enviado el: miércoles,

Re: [R] Percentages in bar plot

2013-01-30 Thread Rui Barradas
Hello, Try barplot(table(stop)/sum(table(stop))) Hope this helps, Rui Barradas Em 30-01-2013 11:34, Naser Jamil escreveu: Dear R-users, Though it's a silly thing to ask, but I'm not getting a way out. I wish to find the percentage distribution for a data vector 'stop'. The coomand below is

[R] texture mapping images on the faces of a cuboid with rgl

2013-01-30 Thread ravi
Hi, I am interested in mapping 6 different images on the faces of a cube. I found the full code for doing this here : http://rwiki.sciviews.org/doku.php?id=graph_gallery:cube But I am unable to adapt the code for my purpose. I would appreciate it if I could get some help on the following points

Re: [R] Change rows and columns

2013-01-30 Thread John Kane
Please reply with context to the list. Most R-help readers do not use nabble. I don't quite understand your question but do you mean something like ?names? John Kane Kingston ON Canada -Original Message- From: matthias.we...@fnt.de Sent: Tue, 29 Jan 2013 07:41:21 -0800 (PST) To:

Re: [R] pROC in R

2013-01-30 Thread John Kane
I don't see what is happening from your code but you have a typo in the emai if not in your code. It should be library (pROC) John Kane Kingston ON Canada -Original Message- From: feth...@yahoo.fr Sent: Mon, 28 Jan 2013 14:44:50 + (GMT) To: r-help@r-project.org Subject: [R]

Re: [R] Sweave files generating miktex errors

2013-01-30 Thread Troy S
Michael, I added C:\R\R-2.15.2\share\texmf to the list of roots and hit apply and that solved the problem. Thanks! Duncan, I did try the R CMD Sweave you suggested and that did not solve the issue. The problem was in running LaTeX so how was your suggestion help me? It would have to copy the

Re: [R] Fastest way to compare a single value with all values in one column of a data frame

2013-01-30 Thread arun
HI, Sorry, my previous solution doesn't work. This should work for your dataset: set.seed(1851) x- data.frame(item=sample(letters[1:5],20,replace=TRUE),a=sample(1:15,20,replace=TRUE),b=sample(20:30,20,replace=TRUE),stringsAsFactors=F) y- data.frame(item=f,a=3,b=10,stringsAsFactors=F)  

Re: [R] Relative Risk in logistic regression

2013-01-30 Thread Kevin E. Thorpe
On 01/30/2013 09:02 AM, nalluri pratap wrote: Relative risk = exp(coef(model)) Only if you fit using the log link. Using the logit link, this gives odds ratios. --- On Wed, 30/1/13, aminreza Aamini amin.r@gmail.com wrote: From: aminreza Aamini amin.r@gmail.com Subject: [R]

Re: [R] how to use ...

2013-01-30 Thread Patrick Burns
There is now a blog post that attempts to answer the question in the subject line: http://www.burns-stat.com/the-three-dots-construct-in-r/ Pat On 17/01/2013 14:36, Ivan Calandra wrote: Dear users, I'm trying to learn how to use the I have written a function (simplified here) that uses

Re: [R] Relative Risk in logistic regression

2013-01-30 Thread John Sorkin
I am not sure why one would want a relative risk from a logistic regression. The measure of association from a logistic regression is the odds ratio, not the relative risk. John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine

Re: [R] Relative Risk in logistic regression

2013-01-30 Thread Kevin E. Thorpe
On 01/30/2013 11:17 AM, John Sorkin wrote: I am not sure why one would want a relative risk from a logistic regression. The measure of association from a logistic regression is the odds ratio, not the relative risk. John Yes, the natural measure, when using the logit link, is the OR. I

Re: [R] Relative Risk in logistic regression

2013-01-30 Thread John Sorkin
If you use a log link, you are not, I believe, performing a logistic regression! John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD

Re: [R] Programmatically give file name to a matrix

2013-01-30 Thread Greg Snow
This is FAQ 7.21. The most important part of that answer is at the end where it says that it is better to use a list. Your code could be something like: plotroc - list() for (i in levels(mergeTrn$Continent) { # matrix defined here plotroc[[ paste(plotroc_GBM_TRN_,i, sep=) ]] - matrix } now

Re: [R] Relative Risk in logistic regression

2013-01-30 Thread Kevin E. Thorpe
On 01/30/2013 11:26 AM, John Sorkin wrote: If you use a log link, you are not, I believe, performing a logistic regression! I guess strictly speaking, that is true. I was being a little sloppy in terminology. Kevin E. Thorpe kevin.tho...@utoronto.ca 1/30/2013 11:22 AM On 01/30/2013

Re: [R] RandomForest and Missing Values

2013-01-30 Thread nalluri pratap
If you wish to remove missing values, you can use the option na.action=na.omit.If you wish to Impute you can use rfImpute. --- On Mon, 28/1/13, Lorenzo Isella lorenzo.ise...@gmail.com wrote: From: Lorenzo Isella lorenzo.ise...@gmail.com Subject: [R] RandomForest and Missing Values To:

Re: [R] how to use ...

2013-01-30 Thread Bert Gunter
Because R can be interactive, I find that a little exploring through the use of strategically placed browser() calls (?browser if you are unfamiliar with this handy debugging tool) is often the fastest way to solve little R puzzles like this. For example, try this (in an R GUI): f2 -

Re: [R] Sweave files generating miktex errors

2013-01-30 Thread Duncan Murdoch
On 13-01-30 11:00 AM, Troy S wrote: Michael, I added C:\R\R-2.15.2\share\texmf to the list of roots and hit apply and that solved the problem. Thanks! Duncan, I did try the R CMD Sweave you suggested and that did not solve the issue. The problem was in running LaTeX so how was your

Re: [R] Sweave files generating miktex errors

2013-01-30 Thread Troy S
Duncan, Alas, I had left out the --pdf flag when I tried the solution. I am glad I have an answer now, and a better understanding of the problem. Troy On Wed, Jan 30, 2013 at 9:50 AM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On 13-01-30 11:00 AM, Troy S wrote: Michael, I added

Re: [R] Fastest way to compare a single value with all values in one column of a data frame

2013-01-30 Thread Dimitri Liakhovitski
Thank you, everyone! I'll try to test those different approaches. Really appreciate your help! Dimitri On Wed, Jan 30, 2013 at 11:03 AM, arun smartpink...@yahoo.com wrote: HI, Sorry, my previous solution doesn't work. This should work for your dataset: set.seed(1851) x-

Re: [R] Fastest way to compare a single value with all values in one column of a data frame

2013-01-30 Thread Dimitri Liakhovitski
Sorry - I should have clarified: My identifiers (in column item) will always be unique. In other words, one entry in column item will never be repeated - neither in x nor in y. Dimitri On Wed, Jan 30, 2013 at 1:27 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Thank you,

Re: [R] Fastest way to compare a single value with all values in one column of a data frame

2013-01-30 Thread arun
Hi, Any chance x$a to have the same number repeated? If `Item` and `a` are unique,  I guess both the solutions should work. set.seed(1851) x- data.frame(item=sample(letters[1:20],20,replace=F),a=sample(1:45,20,replace=F),b=sample(20:50,20,replace=F),stringsAsFactors=F) y-

Re: [R] starting values in glm(..., family = binomial(link =log))

2013-01-30 Thread Fischer, Felix
Thanks for your replies! It seems, that I can fit my model now, when I can provide the right starting values; however there remain warnings, such as: 1: In log(ifelse(y == 1, 1, (1 - y)/(1 - mu))) : NaNs wurden erzeugt 2: step size truncated due to divergence 3: step size truncated: out of

[R] Going in circles

2013-01-30 Thread Casey,Richard
Hi, we're trying to install rJava on SLES 11. With: R CMD INSTALL rJava_0.9-3.tar.gz It says: configure: error: One or more Java configuration variables are not set. Make sure R is configured with full Java support (including JDK). Run R CMD javareconf as root to add Java support to R. So we

[R] starting values in glm(..., family = binomial(link =log))

2013-01-30 Thread Ravi Varadhan
Try this: Age_log_model = glm(Arthrose ~ Alter, data=x, start=c(-1, 0), family=quasibinomial(link = log)) Ravi Ravi Varadhan, Ph.D. Assistant Professor The Center on Aging and Health Division of Geriatric Medicine Gerontology Johns Hopkins University

[R] non-metric multidimensional scaling

2013-01-30 Thread Myra Juckers
Hello, I would like to perform an NMDS on the following: I have two independent variables, which are sites and treatments. I have 6 sites which are peatlands. I collected 5 replicates (at the same time) from each of the sites. I used each of the replicates in a treatment. There were 4

[R] How does predict() calculate prediction intervals?

2013-01-30 Thread Kurt Rinehart
For a given linear regression, I wish to find the 2-tailed t-dist probability that Y-hat = newly observed values. I generate prediction intervals in predict() for plotting, but when I calculate my t-dist probabilities, they don't agree. I have researched the issues with variance of individual

Re: [R] starting values in glm(..., family = binomial(link =log))

2013-01-30 Thread Ravi Varadhan
I did not get any warnings when I ran your data/model example. From: Fischer, Felix [mailto:felix.fisc...@charite.de] Sent: Wednesday, January 30, 2013 11:19 AM To: Ravi Varadhan Cc: r-help@r-project.org Subject: AW: [R] starting values in glm(..., family = binomial(link =log)) Thanks for your

Re: [R] Add axes to a 3D scene (afer makeTriangles)

2013-01-30 Thread David Winsemius
On Jan 30, 2013, at 3:09 AM, cgenolin wrote: Hi all, I am drawing some 3D surfaces using the Triangle tools (package misc3) and drawScene.rgl. Do you know if it is possible to add axes and graduation on the scene? You offer no code or data, so a specific answer is not called for.

Re: [R] Fastest way to compare a single value with all values in one column of a data frame

2013-01-30 Thread Dimitri Liakhovitski
In realy, values in a will be not integers, but numeric. They will never be identical, but it could be that they are pretty close - I don't know after how many points after the comma matter. Dimitri On Wed, Jan 30, 2013 at 2:06 PM, arun smartpink...@yahoo.com wrote: Hi, Any chance x$a to have

[R] arithmetic and logical operators

2013-01-30 Thread Dave Mitchell
Why, in R, does (0.1 + 0.05) 0.15 evaluate to True? What am I missing here? How can I ensure this (ostensibly incorrect) behavior doesn't introduce bugs into my code? Thanks for your time. Dave Mitchell [[alternative HTML version deleted]]

Re: [R] arithmetic and logical operators

2013-01-30 Thread R. Michael Weylandt
R FAQ 7.31 (Note, this isn't R specific, rather it's a problem with the finitude of computers) MW On Wed, Jan 30, 2013 at 8:32 PM, Dave Mitchell dmmtc...@gmail.com wrote: Why, in R, does (0.1 + 0.05) 0.15 evaluate to True? What am I missing here? How can I ensure this (ostensibly incorrect)

Re: [R] Relative Risk in logistic regression

2013-01-30 Thread David Winsemius
On Jan 30, 2013, at 5:49 AM, aminreza Aamini wrote: Hi all, I am very grateful to all those who write to me 1) how i can obtain relative risk (risk ratio) in logistic regression in R. 2) how to obtain the predicted risk for a certain individual using fitted regression model in R. You

Re: [R] arithmetic and logical operators

2013-01-30 Thread Berend Hasselman
On 30-01-2013, at 21:32, Dave Mitchell dmmtc...@gmail.com wrote: Why, in R, does (0.1 + 0.05) 0.15 evaluate to True? What am I missing here? How can I ensure this (ostensibly incorrect) behavior doesn't introduce bugs into my code? Thanks for your time. R-FAQ 7.31:

Re: [R] arithmetic and logical operators

2013-01-30 Thread William Dunlap
Why, in R, does (0.1 + 0.05) 0.15 evaluate to True? Because floating point arithmetic is done with a fixed number of digits. If you are working in base 10 and have 2 digits to work with you would have 1/3 - .33 2/3 - .67 so that 1/3 + 1/3 2/3 How can I ensure this (ostensibly

Re: [R] How does predict() calculate prediction intervals?

2013-01-30 Thread Rolf Turner
Just look at the code of predict.lm(). It is reasonably perspicuous. In particular look at res.var. cheers, Rolf Turner On 01/31/2013 05:50 AM, Kurt Rinehart wrote: For a given linear regression, I wish to find the 2-tailed t-dist probability that Y-hat = newly observed values.

[R] testing the multiple regression model

2013-01-30 Thread dada
Hi I have 25 samples in my dataset. I have written a multiple regression model and I would like to test it. I would like to train my model on 20 samples and then test it on 5 remaining. However I would like to test the model several times, each time using different 5 samples out of 25 and check

[R] fSeries not found in R

2013-01-30 Thread Yuan, Rebecca
Hello all, When I tried to install fSeries in R, I got the following error messages: install.packages(fSeries,dependencies=T) Warning message: package 'fSeries' is not available (for R version 2.15.2) Is this package changing/merging to another package? Thanks, Rebecca

Re: [R] export figure by pdf command

2013-01-30 Thread MacQueen, Don
Works for me, so you will have to provide more information. x11() hist(rnorm(100)) dev.copy2pdf(file='mytest.pdf') X11 2 list.files(patt='mytest') [1] mytest.pdf -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On

Re: [R] Programmatically give file name to a matrix

2013-01-30 Thread Kumar Mainali
Thank you Pascal and Greg for the suggestion. That is exactly what I needed! - Kumar On Wed, Jan 30, 2013 at 2:14 AM, Pascal Oettli kri...@ymail.com wrote: Hello, ?assign assign(paste(plotroc_GBM_Trn_**, i, sep=), matrix(rnorm(100),10,10)) HTH, Pascal Le 30/01/2013 17:04, Kumar

Re: [R] arithmetic and logical operators

2013-01-30 Thread Ted Harding
On 30-Jan-2013 20:39:34 Berend Hasselman wrote: On 30-01-2013, at 21:32, Dave Mitchell dmmtc...@gmail.com wrote: Why, in R, does (0.1 + 0.05) 0.15 evaluate to True? What am I missing here? How can I ensure this (ostensibly incorrect) behavior doesn't introduce bugs into my code? Thanks

[R] Packages with functionality related to Oil/Gas exploration

2013-01-30 Thread Keith Weintraub
Folks, As the subject describes: I would like to know if there are packages that have functionality tailored for standard Oil/Gas exploration and monetization. Thanks, KW -- [[alternative HTML version deleted]] __ R-help@r-project.org

[R] XBRL data into R?

2013-01-30 Thread Anika Masters
Has anyone explored pulling XBRL formatted data into R? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Integration of mixed normal distribution

2013-01-30 Thread David Winsemius
On Jan 30, 2013, at 4:19 AM, Johannes Radinger wrote: Hi, I already found a conversation on the integration of a normal distribution and two suggested solutions (https://stat.ethz.ch/pipermail/r-help/2007-January/124008.html): 1) integrate(dnorm, 0,1, mean = 0, sd = 1.2) and 2) pnorm(1,

Re: [R] Packages with functionality related to Oil/Gas exploration

2013-01-30 Thread Ben Bolker
Keith Weintraub kw1958 at gmail.com writes: Folks, As the subject describes: I would like to know if there are packages that have functionality tailored for standard Oil/Gas exploration and monetization. Check out the sos package: it will help you answer the question yourself,

Re: [R] How does predict() calculate prediction intervals?

2013-01-30 Thread Cade, Brian
Kurt: You missed including the term 1/n in your var.y.hat calculation. Do that and pred and hand are the same. Brian Brian S. Cade, PhD U. S. Geological Survey Fort Collins Science Center 2150 Centre Ave., Bldg. C Fort Collins, CO 80526-8818 email: brian_c...@usgs.gov tel: 970 226-9326

[R] betadisper plot

2013-01-30 Thread Myra Juckers
Hello, I tried to make a betadisper plot; however, it is quite messy at the moment with lines and symbols. I made two plots, one focusing on sites and the other on treatments. This is the code that I used: plot(betadisper(vegdist(y.nth,method=euclidean),site))

[R] Writing audio files (.wav) in a different directory

2013-01-30 Thread Humberto Mohr
Hi. I'm trying to export a .wav file using the writeWave function from tuneR package in a different folder than the default getwd(). After reading through the manuals of some audio packages I couldn't figure it out. I'm picking one 3-hour .wav file and asking the function to take a sample of 1

[R] Writing audio files (.wav) in a different directory

2013-01-30 Thread Humberto Mohr
Hi. I'm trying to export a .wav file using the writeWave function from tuneR package in a different folder than the default getwd(). After reading through the manuals of some audio packages I couldn't figure it out. I'm picking one 3-hour .wav file and asking the function to take a

[R] Please, problem using “bcPower”

2013-01-30 Thread Beatriz González
Hello, I would like to perform a Box-Cox (“bcPower”) transformation on my data. For this, I am determining lambda using the “powerTransform” function. However, with one of my variables I get the following Warning Message: In estimateTransform(x, y, NULL, ...) : Convergence failure:

[R] Package name

2013-01-30 Thread Ortiz, John
Dear list, Can I use a character to set the name of a R package? like this (-) for example (sdp-R) Thanks, John __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Writing audio files (.wav) in a different directory

2013-01-30 Thread Jeff Newmiller
Put the directory name into the filename string. The syntax for doing that is somewhat OS dependent, but for most cases you can use / as the separator. You really should Google file path and your OS and learn how to do this, because it is broadly applicable outside of R (not an R-help

Re: [R] Add axes to a 3D scene (afer makeTriangles)

2013-01-30 Thread Christophe Genolini
Hi David, Thanks for your answer. Here is my (simplified) code : 8 - library(misc3d) # ### Fonction that draw a point A=(x,y,z), with radius r misc3dPoint - function(A,r,color=black,alpha=1){ t1 -