[R] axis labels defaulting to scientific notation

2010-08-10 Thread Watkins, Janice
The labels on the x-axis are defaulting to scientific notation no matter how small cex.axis is. How can I override scientific notation to get the labels to print out as specified? Here is the code (UNIT here is 0.0105): plot(xm,yv,log="xy",ylim=c(0.1,20)/UNIT,xlim=c(0.004,20)*UNIT,xaxt="n",t ype=

[R] Std. error of correlation coefficients

2010-08-10 Thread fusun gonul
How do I get the std. errors of correlation coefficients? When I use the cor function it only prints the correlation. Thanks, Fusun. -- View this message in context: http://r.789695.n4.nabble.com/Std-error-of-correlation-coefficients-tp2320609p2320609.html Sent from the R help mailing list arch

[R] problem with Bitmap

2010-08-10 Thread kayj
Hi All, I am trying to run the following script but I am getting and error message one=read.table("sample.txt",sep="\t") bitmap(file="sample.JPG",type="jpeg",width=5,height=5,res=300,pointsize=10) “Error in (st + 1):(en - 1) : argument of length 0” plot(one$V1,one$V2) I tried to google the error

Re: [R] [BUGS] [R-BUGS] error while plotting

2010-08-10 Thread Anamika Chaudhuri
Trevor, Thanks for your reply. That doesnot help Any other suggestions? Anamika On Tue, Aug 10, 2010 at 11:58 AM, Trevor Davies wrote: > I think you need to load is R2WinBUGS again. > > require(R2WinBUGS) > > Trevor > > > Hi All: > > > > I am getting an error while trying to plot in R2Winbugs >

[R] Error: the leading minor of order 6 is not positive definite

2010-08-10 Thread stompper33
Hey guys, I'm trying to run a Canonical Correlation Analysis (CCA) between two data sets. But for my case I am dealing with data sets(which are stored as two matrices X and Y) in which the number of experimental units is greater than the number of variables, so I want to use a sample from my "mot

Re: [R] package for measurement error models

2010-08-10 Thread Prof Brian Ripley
On Tue, 10 Aug 2010, Carrie Li wrote: Thank you both! I found that the model with both x and y have measurement errors should be pretty common in practice. But it seems to me that there is no a simple solution for it...(I mean, a ready-to-use package or program handing this model fitting proble

[R] sweep and zoo objects

2010-08-10 Thread steven mosher
rc<-list(c( 123,321,234,543,654,768,986,987,246,284),c("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")) # the matrix has rownames that are used as identifiers and columns # of time. 1 years worth of data. Thats the native format test<-matrix(seq(1,120, by=1), nrow=10,dim

Re: [R] Where to download files for ANOVA test?

2010-08-10 Thread David Winsemius
On Aug 11, 2010, at 12:36 AM, Stephen Liu wrote: - Original Message From: David Winsemius To: Stephen Liu Cc: r-help@r-project.org Sent: Wed, August 11, 2010 11:42:55 AM Subject: Re: [R] Where to download files for ANOVA test? - snip - Please advise where can I find a bigger

Re: [R] Where to download files for ANOVA test?

2010-08-10 Thread Stephen Liu
> - Original Message > From: David Winsemius > To: Stephen Liu >Cc: r-help@r-project.org >Sent: Wed, August 11, 2010 11:42:55 AM >Subject: Re: [R] Where to download files for ANOVA test? - snip - >> >> Please advise where can I find a bigger size sample files >> for my test? > http:

Re: [R] Where to download files for ANOVA test?

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 10:28 PM, Stephen Liu wrote: Hi folks, I'm learning ANOVA needing sample data files for the test. data() displays many data files. But I have no idea which of them is suitable for my application. I also found following thread; R and Analysis of Variance http://www.

[R] Where to download files for ANOVA test?

2010-08-10 Thread Stephen Liu
Hi folks, I'm learning ANOVA needing sample data files for the test. > data() displays many data files. But I have no idea which of them is suitable for my application. I also found following thread; R and Analysis of Variance http://www.personality-project.org/R/r.anova.html The sample d

Re: [R] TRUE FALSE issue

2010-08-10 Thread Bill.Venables
For huge cases this might be a whiff faster > with(a, Samples[rowSums(a[, -1], na.rm = TRUE) > 0]) [1] S2 S4 Levels: S1 S2 S3 S4 S5 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of bill.venab...@csiro.au Sent: Wednesday, 11 August

Re: [R] TRUE FALSE issue

2010-08-10 Thread Bill.Venables
> with(a, Samples[apply(a[,-1], 1, any)]) [1] S2 S4 Levels: S1 S2 S3 S4 S5 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Alexander Eggel Sent: Wednesday, 11 August 2010 12:05 PM To: r-help@r-project.org Subject: [R] TRUE FALSE is

Re: [R] TRUE FALSE issue

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 10:16 PM, Erik Iverson wrote: On 08/10/2010 09:04 PM, Alexander Eggel wrote: How can I extract the samples (S1-S5) containing a TRUE value in their row? Solution should apply to a much bigger data frame. a Samples A B C D . . . 1 S1 FALSE FALSE FALSE FALSE 2 S2 FALSE F

Re: [R] TRUE FALSE issue

2010-08-10 Thread Erik Iverson
On 08/10/2010 09:04 PM, Alexander Eggel wrote: How can I extract the samples (S1-S5) containing a TRUE value in their row? Solution should apply to a much bigger data frame. a Samples A B C D . . . 1 S1 FALSE FALSE FALSE FALSE 2 S2 FALSE FALSE NA TRUE 3 S3 FALSE FALSE FALSE FALSE 4 S4 FALSE TR

[R] TRUE FALSE issue

2010-08-10 Thread Alexander Eggel
How can I extract the samples (S1-S5) containing a TRUE value in their row? Solution should apply to a much bigger data frame. > a Samples A B C D . . . 1 S1 FALSE FALSE FALSE FALSE 2 S2 FALSE FALSE NA TRUE 3 S3 FALSE FALSE FALSE FALSE 4 S4 FALSE TRUE FALSE FALSE 5 S5 FALSE FALSE FALSE FALSE . . .

Re: [R] Intersecting list vs rows in matrix

2010-08-10 Thread GL
Very cool. Thanks! -Original Message- From: "Henrique Dallazuanna [via R]" To: Lipori, Gigi Sent: 08/10/2010 05:18:25 PM Subject: Re: Intersecting list vs rows in matrix Try this: colSums(apply(List_2, 1, is.element, List_1)) > 0 On Tue, Aug 10, 2010 at 5:42 PM, GL wrote: >

Re: [R] svydesign syntax and deviance!

2010-08-10 Thread Thomas Lumley
On Sat, 31 Jul 2010, aline uwimana wrote: Thank you Thomas,  if i understand what you say below i need to use glm in order to have the deviance and consider it for the model with svyglm and choose the best model. I use  glm and svyglm for two models but don't have deviance for the svyglm. As i

[R] Variance inflation factor

2010-08-10 Thread Grant Gillis
Hello all and thanks in advance for any advice. I would like to calculate the variance inflation factor for a linear model (lm) with 4 explanatory variables. I would then like to use this to calculate QAIC. I have used the function vif() in the car package and I get values for each variable howe

[R] Bigmemory: Error Running Example

2010-08-10 Thread harsh yadav
Hi, I am trying to run the bigmemory example provided on the http://www.bigmemory.org/ The example runs on the "airline data" and generates summary of the csv files:- library(bigmemory) library(biganalytics) x <- read.big.matrix("2005.csv", type="integer", header=TRUE, backingfile="airline.bin",

Re: [R] Multiple imputation, especially in rms/Hmisc packages

2010-08-10 Thread Mark Seeto
Hi Frank (and others), Thank you for your comments in reply to my questions. I had not encountered contrast tests before. I've looked in a few texts, but the only place I could find anything about contrast tests was your Regression Modeling Strategies book. You wrote that the "leave some var

[R] question about bayesian model selection for quantile regression

2010-08-10 Thread Xin__ Li
Hi All: Recently I am researching my dissertation about the quantile model selection by bayesian approach. I have the dependent variable(return) and 16 independent variables and I need to select the best variable for each quantile of return. And the method I used is the bayesian approach, which is

Re: [R] how to draw a spherical quadrant

2010-08-10 Thread [Ricardo Rodriguez] Your XEN ICT Team
Thanks for pointing me on that direction! Extremely feature-rich this, as usual, package! Duncan Murdoch wrote: The rgl package can do general 3D plotting, but I don't know of anyone who has put together what you're looking for, so you'll need to compute the individual line segments or polyg

Re: [R] Intersecting list vs rows in matrix

2010-08-10 Thread Henrique Dallazuanna
Try this: colSums(apply(List_2, 1, is.element, List_1)) > 0 On Tue, Aug 10, 2010 at 5:42 PM, GL wrote: > > Know that if I have List_1 and List_2 that I can check to see if the > intersect via the code below: > > List _1: > a, b, c, d, e, f, g > List_2: > z, y, x, w, v, u, b > length(intersect

Re: [R] Intersecting list vs rows in matrix

2010-08-10 Thread Wu Gong
Hi GL, Erik has given a data.frame solution. If you data is a list with unequal lengths, try lapply. - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/Intersecting-list-vs-rows-in-matrix-tp2320427p2320463.html Sent from the R help mailing list archive at Nabble.

Re: [R] Intersecting list vs rows in matrix

2010-08-10 Thread Erik Iverson
GL wrote: Know that if I have List_1 and List_2 that I can check to see if the intersect via the code below: List _1: a, b, c, d, e, f, g List_2: z, y, x, w, v, u, b length(intersect(List_1, List_2)) > 0 return = true If instead I wanted to check a dataframe that is a "list of lists," ho

Re: [R] Importing arguments for use by functions in a script

2010-08-10 Thread Joshua Wiley
"I just got caught up with the not being able to do something" I have done that so frequently I think I should include at the beginning of each of my R sessions: "When you find the path hard and steep, it's probably because you missed the trail." It always seems the more frustrating the problem,

Re: [R] How to invert a list ?

2010-08-10 Thread Wu Gong
Hi Carlos, I give a handmade code, hope it helps. y <- list() y$a <- a y$b <- c(b,c) names(y$a) <- "i" names(y$b) <- c("j","k") Carlos Petti wrote: > > a <- 5 > names(a) <- "a" > b <- 9 > names(b) <- "b" > c <- 15 > names(c) <- "c" > x <- list("i" = a, "j" = b, "j" = c) > - A R learner

Re: [R] "regression" line of 2 independent variables

2010-08-10 Thread David Reiner
If appropriate for your data, you could try errors-in-variables (package leiv) or use the first component from principal components. HTH, -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of array chip Sent: Monday, August 09,

[R] Intersecting list vs rows in matrix

2010-08-10 Thread GL
Know that if I have List_1 and List_2 that I can check to see if the intersect via the code below: List _1: a, b, c, d, e, f, g List_2: z, y, x, w, v, u, b length(intersect(List_1, List_2)) > 0 return = true If instead I wanted to check a dataframe that is a "list of lists," how would I do t

Re: [R] Importing arguments for use by functions in a script

2010-08-10 Thread EvansA
Thank you for your response. Re: "I guess my point with all that is that you might reconsider problem and what your goal is" You are quite right, I just got caught up with the not being able to do something - and now see the error of my ways. But I am glad to see your solution. -- View this m

Re: [R] how to draw a spherical quadrant

2010-08-10 Thread Duncan Murdoch
On 10/08/2010 3:34 PM, [Ricardo Rodriguez] Your XEN ICT Team wrote: Thanks, Jim! Jim Lemon wrote: > You may find that the radial.plot function in the plotrix package will > do what you want. I think you are looking at the polygon type of plot. It seems to me that I've a lot of things to lear

Re: [R] how to draw a spherical quadrant

2010-08-10 Thread [Ricardo Rodriguez] Your XEN ICT Team
Thanks, Jim! Jim Lemon wrote: You may find that the radial.plot function in the plotrix package will do what you want. I think you are looking at the polygon type of plot. It seems to me that I've a lot of things to learn only from plotrix package! With the functions included in this package

Re: [R] sapply/lapply instead of loop

2010-08-10 Thread GL
That works great, and is ever so much simpler. Thanks much! -- View this message in context: http://r.789695.n4.nabble.com/sapply-lapply-instead-of-loop-tp2320265p2320317.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-projec

[R] [R-pkgs] tikzDevice 0.5.0 released to CRAN

2010-08-10 Thread Charlie Sharpsteen
# tikzDevice --- ## Description The tikzDevice package new graphics device for R which enables direct output of graphics in a LaTeX-friendly way. Plotting commands issued by R functions are transformed into LaTeX code blocks. These blocks are interpreted with the help of TikZ-- a graphics libr

Re: [R] sapply/lapply instead of loop

2010-08-10 Thread Henrique Dallazuanna
So try: format(as.matrix(temp)) On Tue, Aug 10, 2010 at 4:13 PM, GL wrote: > > Both of those approaches seem to return (" v75") instead of ("v75 "). > -- > View this message in context: > http://r.789695.n4.nabble.com/sapply-lapply-instead-of-loop-tp2320265p2320305.html > Sent from the R help

Re: [R] sapply/lapply instead of loop

2010-08-10 Thread GL
Both of those approaches seem to return (" v75") instead of ("v75 "). -- View this message in context: http://r.789695.n4.nabble.com/sapply-lapply-instead-of-loop-tp2320265p2320305.html Sent from the R help mailing list archive at Nabble.com. __ R-

Re: [R] sapply/lapply instead of loop

2010-08-10 Thread Henrique Dallazuanna
Try this: formatC(as.matrix(temp)) On Tue, Aug 10, 2010 at 3:55 PM, GL wrote: > > Using the input below, can I do something more elegant (and more efficient) > than the loop also listed below to pad strings to a width of 5? The true > matrix is about 300K rows and 31 columns. > > #

Re: [R] matrix problem

2010-08-10 Thread Wu Gong
Hi, I guess you just want to reshape your data to wide format. strs <- "Index Time Value 1 2 0.1 2 3 0.2 3 1 0.3" DF <- read.table(textConnection(strs),header=T) rDF <- reshape(DF, idvar="Index", timevar="Time", direction="wide") rDF[is.na(rDF)] <- 0 - A R learner. -- View this message in

Re: [R] sapply/lapply instead of loop

2010-08-10 Thread jim holtman
will this do what you want: > newTemp[] <- lapply(newTemp, function(.col){ + # convert to character and pad to 5 space + sprintf("%5s", as.character(.col)) + }) > > str(newTemp) 'data.frame': 5 obs. of 3 variables: $ DX1: chr "13761" "63371" "51745" "64081" ... $ DX2: chr " 8125" "

[R] problem installing "boot" package on Mac

2010-08-10 Thread Malcolm Fairbrother
Dear all, I cannot seem to get "boot" running. Can anybody help? I've tried downloading and compiling the binary from , as well as the below. (Please see the scary-sounding error message, and the sessionInfo.) Neither works. Any help wou

[R] sapply/lapply instead of loop

2010-08-10 Thread GL
Using the input below, can I do something more elegant (and more efficient) than the loop also listed below to pad strings to a width of 5? The true matrix is about 300K rows and 31 columns. ### #INPUT ### > temp DX1 DX2 DX3 1 13761 8125 49178 2 6

Re: [R] extracting information from an object

2010-08-10 Thread Erik Iverson
David, I was working on a project involving a linear model, and wanted to extract the standard error of a predictor. I am able to do so, but not in the way I would expect. I would have expected that if a created a model such as Model1 <- lm(y~x,z,d), the object Model1 would contain that info

Re: [R] partial match of one column in data frame to another character vector

2010-08-10 Thread Henrique Dallazuanna
Try this: myData$fullID <- sapply(gsub("^ +| +$", "", myData$id), grep, x = fullID, value = TRUE) On Tue, Aug 10, 2010 at 3:39 PM, Juliet Hannah wrote: > Here is some data (dput output below) > > > myData > id group > 1

[R] partial match of one column in data frame to another character vector

2010-08-10 Thread Juliet Hannah
Here is some data (dput output below) > myData id group 1 D599 A 2 002-0004 B 3 F01932

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Frank Harrell
Thanks Michael, That's the method that Dana Quade taught me in his intro nonparametrics course at UNC in the mid 1970s, at least for a single predictor. His method did not incorporate the shift you mentioned though. The method looks robust. Not sure about efficiency. Frank Frank E Harr

[R] extracting information from an object

2010-08-10 Thread David Howell
I was working on a project involving a linear model, and wanted to extract the standard error of a predictor. I am able to do so, but not in the way I would expect. I would have expected that if a created a model such as Model1 <- lm(y~x,z,d), the object Model1 would contain that information e

Re: [R] matrix problem

2010-08-10 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of zhenjiang xu > Sent: Tuesday, August 10, 2010 11:03 AM > To: R-help@r-project.org > Subject: [R] matrix problem > > Hi, > > I have a file like this: > 1 2 0.1 > 2 3 0.2 > 3 1 0

Re: [R] matrix problem

2010-08-10 Thread Xia.Li
Let me give you a not that efficient one... assume you have read the matrix (named as x) into R: n=dim(x)[1] y=matrix(0,n,n) for (i in 1:n) y[x[i,1],x[i,2]]=x[i,3] -- View this message in context: http://r.789695.n4.nabble.com/matrix-problem-tp2320193p2320219.html Sent from the R help mailin

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Michal Figurski
Peter, Since in P&B the procedure is to calculate a whole list of slopes and intercepts, wouldn't it be a solution to determine the correlation and go from there? How do I do it? -- Michal J. Figurski, PhD HUP, Pathology & Laboratory Medicine Biomarker Research Laboratory 3400 Spruce St. 7 Ma

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Michal Figurski
Frank, I had to order this article through Inter-Library Loan and wait for it for a week! I'll try to make it short. In Passing-Bablok the principle is to calculate slopes between all possible pairs of points in the dataset, and then to take a "shifted" median of those slopes, where the offs

Re: [R] matrix problem

2010-08-10 Thread Henrique Dallazuanna
Try this: Lines <- '1 2 0.1 2 3 0.2 3 1 0.3' DF <- read.table(textConnection(Lines)) m <- matrix(0, ncol = nrow(DF), nrow = nrow(DF)) m[as.matrix(DF[1:2])] <- DF[[3]] On Tue, Aug 10, 2010 at 3:03 PM, zhenjiang xu wrote: > Hi, > > I have a file like this: > 1 2 0.1 > 2 3 0.2 > 3 1 0.3 > > And I

[R] matrix problem

2010-08-10 Thread zhenjiang xu
Hi, I have a file like this: 1 2 0.1 2 3 0.2 3 1 0.3 And I want to read it to create a matrix like this: [,1] [,2][,3] [1,]0 0.1 0 [2,]0 00.2 [3,]0.300 How can I do it efficiently? Thanks. -- Best, Zhenjiang [[alternative HTM

[R] Error in R2Bugs

2010-08-10 Thread John Poulsen
Hello, I am running a GLMM using R2Bugs, but am getting the below error message. I am including the entire output, although the 2nd and 3rd lines seem to indicate the problem. Note that I do define N (it is an integer) and send it to a datalist (see the R commands and model below). Interesti

Re: [R] How to invert a list ?

2010-08-10 Thread Henrique Dallazuanna
Here is one way: xst <- stack(x) let <- letters[cumsum(duplicated(match(xst$ind, letters))) + match(xst$ind, letters)] with(xst, structure(split(structure(values, names = let), ind), .Names = row.names(xst)[1:length(unique(ind))])) On Tue, Aug 10, 2010 at 1:58 PM, Carlos Petti wrote: > De

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Peter Dalgaard
Michal Figurski wrote: > # And the result of the Passing-Bablok regression on this data frame: > Estimate 5%CI 95%CI > Intercept -4.306197 -9.948438 -1.374663 > Slope 1.257584 1.052696 1.679290 > > The original Passing & Bablok article on this method has an easy > pre

Re: [R] Function to Define a Function

2010-08-10 Thread S Ellison
Neat. But why assign the functions to separate variables at all? mdlChooser <- function(type=c("one","two")) { type <- match.arg(type) m <- switch(type, one=function(x,N0,r) N0*exp(x*r) , two=function(x,N0,r,K) (N0*K)/(N0+(K-N0)*exp(-x*r)) ) m } also works without appearing to

[R] How to invert a list ?

2010-08-10 Thread Carlos Petti
Dear list, I have a list, as follows : a <- 5 names(a) <- "a" b <- 9 names(b) <- "b" c <- 15 names(c) <- "c" x <- list("i" = a, "j" = b, "j" = c) I want to invert the list, like this : $a i 5 $b j k 9 15 I do not find a clean solution. Could anyone give me elegant ideas ? Thanks in advance

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 12:12 PM, Michal Figurski wrote: David, I would consider myself intermediate in R, but a beginner in statistics. I need a formula that would allow me to calculate confidence boundaries of the regression line given the slope, intercept and their CIs (and *any* range).

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Frank Harrell
Please give the prescription. The article is not available on our extensive online library. I wonder if the method can compete with the bootstrap. Frank Frank E Harrell Jr Professor and ChairmanSchool of Medicine Department of Biostatistics Vanderbilt Unive

Re: [R] Function to Define a Function

2010-08-10 Thread Martin Maechler
> Gabor Grothendieck > on Mon, 9 Aug 2010 23:20:18 -0400 writes: > On Mon, Aug 9, 2010 at 9:31 PM, Derek Ogle wrote: >> I am trying to define a general R function that has a >> function as the output that depends on the user's input >> arguments (this may make more s

Re: [R] p-values with pvclust

2010-08-10 Thread Greg Snow
I don't know much about pvclust itself, but you might consider the technique in this paper: Buja, A., Cook, D. Hofmann, H., Lawrence, M. Lee, E.-K., Swayne, D.F and Wickham, H. (2009) Statistical Inference for exploratory data analysis and model diagnostics Phil. Trans. R. Soc. A 2

Re: [R] Function to Define a Function

2010-08-10 Thread Thomas Lumley
On Mon, 9 Aug 2010, Derek Ogle wrote: I am trying to define a general R function that has a function as the output that depends on the user's input arguments (this may make more sense by looking at the toy example below). My real use for this type of code is to allow a user to choose from ma

Re: [R] influence measures for multivariate linear models

2010-08-10 Thread Peter Dalgaard
Michael Friendly wrote: > Barrett & Ling, JASA, 1992, v.87(417), pp184-191 define general classes > of influence measures for multivariate > regression models, including analogs of Cook's D, Andrews & Pregibon > COVRATIO, etc. As in univariate > response models, these are based on leverage and r

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Michal Figurski
David, I would consider myself intermediate in R, but a beginner in statistics. I need a formula that would allow me to calculate confidence boundaries of the regression line given the slope, intercept and their CIs (and *any* range). Passing-Bablok regression doesn't yet exist in R - I am d

Re: [R] Concatenate a mix of numbers and letters to create a vector name

2010-08-10 Thread Greg Snow
Others gave you some examples using assign, which is the same information as in the FAQ. But I expect that you will be better served by using a list (you can use the paste function to create the names for the list elements) rather than assign and global variables. Something like: mylist <- li

Re: [R] Function to Define a Function

2010-08-10 Thread Greg Snow
What if you change your function to: mdlChooser <- function(type=c("one","two")) { type <- match.arg(type) switch(type, one={ function(x,N0,r) N0*exp(x*r) }, two={ function(x,N0,r,K) (N0*K)/(N0+(K-N0)*exp(-x*r)) }, ) } Does that work for you? -- Gregory (Greg) L. Snow Ph.D. Statis

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 11:23 AM, Michal Figurski wrote: David, I may have stated my problem incorrectly - my problem is to *obtain the coordinates* for confidence boundary lines. As input data I have only CIs for slope and intercept. Wouldn't you also need to specify the range over which th

[R] useR! 2011: announcement and call for tutorials

2010-08-10 Thread Heather Turner
We are pleased to announce that the R user conference useR! 2011 is scheduled for August 16-18, 2011, and will take place at the University of Warwick, Coventry, UK. As for the predecessor conferences, the program will consist of two parts: invited lectures and user-contributed sessions (abst

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Michal Figurski
David, I may have stated my problem incorrectly - my problem is to *obtain the coordinates* for confidence boundary lines. As input data I have only CIs for slope and intercept. rms/Hmisc packages are very nice, but unfortunately they do not work with Passing-Bablok nor 'nls' models. -- Mi

Re: [R] Fwd: List of lists ?

2010-08-10 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Carlos Petti > Sent: Tuesday, August 10, 2010 6:12 AM > To: r-help@r-project.org > Subject: [R] Fwd: List of lists ? > > -- Forwarded message -- > From: Carlos Pe

Re: [R] grep problem decimal points looping

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 11:14 AM, RCulloch wrote: Hi David, Thanks very much for that reply! I might be a touch out of my comfort zone, but I can see how the loop script works and where I went wrong, but I'm not sure if I am asking the correct questions here, or perhaps more accurately I'm

Re: [R] grep problem decimal points looping

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 9:17 AM, RCulloch wrote: Hi R Users, I have been trying to work out how to rename column names using grep, basically I have generated these column names using tapply: [1] "NAME" "X1.1" "X2.1" "X3.1" "X4.1" "X5.1" "X6.1" "X7.1" "X8.1" [10] "X1.2" "X2.2" "X3.2"

Re: [R] Numerical Methods Course

2010-08-10 Thread Matt Shotwell
TGS, Given that you have to pay an outrageous $155.86 for that book, it seems reasonable to look for a free environment for numerical computing (like R!). If your instructor says that such a variety of programming languages would work, you could probably make a good argument to use R. But why not

Re: [R] grep problem decimal points looping

2010-08-10 Thread RCulloch
Hi David, Thanks very much for that reply! I might be a touch out of my comfort zone, but I can see how the loop script works and where I went wrong, but I'm not sure if I am asking the correct questions here, or perhaps more accurately I'm using the wrong command for the task in question - and

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 10:56 AM, Michal Figurski wrote: Dear R-helpers and graphics gurus, I have two problems with plotting confidence bands: 1. First is relatively simple. I am using the Passing-Bablok procedure to obtain "unbiased" regression coefficients. This procedure yields the "a" &

[R] influence measures for multivariate linear models

2010-08-10 Thread Michael Friendly
Barrett & Ling, JASA, 1992, v.87(417), pp184-191 define general classes of influence measures for multivariate regression models, including analogs of Cook's D, Andrews & Pregibon COVRATIO, etc. As in univariate response models, these are based on leverage and residuals based on omitting one (o

Re: [R] [Fwd: Re: optimization subject to constraints]

2010-08-10 Thread Ravi Varadhan
I think the problem is because the the Hessian of the augmented Lagrangian iis singular at c(0,0). Try this: require(alabama) heq <- function(x) { x[1]^2+x[2]^2 - 1 } > constrOptim.nl(par=c(0,0), fn=f, heq=heq, control.outer=list(trace=FALSE)) $par [1] -0.7071067 -0.7071067 $value [1] -1.41

[R] Plotting confidence bands around regression line

2010-08-10 Thread Michal Figurski
Dear R-helpers and graphics gurus, I have two problems with plotting confidence bands: 1. First is relatively simple. I am using the Passing-Bablok procedure to obtain "unbiased" regression coefficients. This procedure yields the "a" & "b" coefficient values along with their confidence interva

[R] Numerical Methods Course

2010-08-10 Thread TGS
I want to take this numerical methods course where the text is http://www.amazon.com/Numerical-Methods-J-Douglas-Faires/dp/0534407617 . The instructor recommends MATLAB, but states Fortran, C, Mathematica, or Maple will also do the job. Will R do the job as well? If not, where do you think it

[R] How to build R on Mac to keep packages running?

2010-08-10 Thread Karsten Wolf
Hi there, I am trying to install RApache on my Mac (see http://worldofrcraft.blogspot.com/2010/08/installing-rapache-on-mac-os-x-snow.html). I needed to build R with --enable-R-shlib option, so very naively did the following ./configure --enable-R-shlib make sudo make install RApache runs like

Re: [R] grep problem decimal points looping

2010-08-10 Thread Henrique Dallazuanna
Try this also: nm <- scan('clipboard', what = '') transform(structure(do.call(rbind, strsplit(nm[-1], "\\.")), .Dimnames = list(NULL, c('V1', 'V2'))), V1 = gsub("X", "", V1)) On Tue, Aug 10, 2010 at 10:17 AM, RCulloch wrote: > > Hi R Users, > > I have been trying to work out how to rename column

Re: [R] memory use without running gc()

2010-08-10 Thread Johann Hibschman
Allan Engelhardt writes: > ### Method 2 > ## Setup > file <- paste("/proc", Sys.getpid(), "stat", sep = "/") > what <- vector("list", 44); what[[23]] <- integer(0) > ## In your logging routine > vsz <- scan(file, what = what, quiet = TRUE)[[23]]/1024 > cat("Virtual size: ", vsz, "\n", sep = "")

Re: [R] grep problem decimal points looping

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 9:51 AM, David Winsemius wrote: On Aug 10, 2010, at 9:17 AM, RCulloch wrote: Hi R Users, I have been trying to work out how to rename column names using grep, basically I have generated these column names using tapply: [1] "NAME" "X1.1" "X2.1" "X3.1" "X4.1" "X5.1"

[R] [Fwd: Re: optimization subject to constraints]

2010-08-10 Thread Gildas Mazo
--- Begin Message --- Danke schön Matthias. I had naively started with x0 = c(0,0) and I got a "Redundant constraints were found" error. What's the problem with (0,0) ? Matthias Gondan a écrit : > try this (package Rsolnp) > > library(Rsolnp) > > g<- function(x) > { > return(x[1]^2+x[2

[R] grep problem decimal points looping

2010-08-10 Thread RCulloch
Hi R Users, I have been trying to work out how to rename column names using grep, basically I have generated these column names using tapply: [1] "NAME" "X1.1" "X2.1" "X3.1" "X4.1" "X5.1" "X6.1" "X7.1" "X8.1" [10] "X1.2" "X2.2" "X3.2" "X4.2" "X5.2" "X6.2" "X7.2" "X8.2" "X1.3

Re: [R] optimization subject to constraints

2010-08-10 Thread Matthias Gondan
try this (package Rsolnp) library(Rsolnp) g<- function(x) { return(x[1]^2+x[2]^2) } # constraint f<- function(x) { return(x[1]+x[2]) } # objective function x0 = c(1, 1) solnp(x0, fun=f, eqfun=g, eqB=c(1)) Am 10.08.2010 14:59, schrieb Gildas Mazo: Thanks, but I still cannot get to sol

[R] Fwd: List of lists ?

2010-08-10 Thread Carlos Petti
-- Forwarded message -- From: Carlos Petti Date: 2010/8/10 Subject: Re: [R] List of lists ? To: David Winsemius Perhaps a solution : x <- list() x[[2]] <- list() x[[2]][[1]] <- c(1, 2, 3) x[[2]][[2]] <- c(3, 2, 1) 2010/8/10 Carlos Petti : > Thanks for answer. > > I read the e

[R] Fwd: List of lists ?

2010-08-10 Thread Carlos Petti
-- Forwarded message -- From: Carlos Petti Date: 2010/8/10 Subject: Re: [R] List of lists ? To: David Winsemius Thanks for answer. I read the error messages but I did not find the solution :-( Your solution works. But, a new problem remains because I want to use the list of li

Re: [R] optimization subject to constraints

2010-08-10 Thread Gildas Mazo
Thanks, but I still cannot get to solve my problem: consider this simple example: f <- function(x){ return(x[1]+x[2]) } # objective function g <- function(x){ return(x[1]^2+x[2]^2) } # constraint # I wanna Maximize f(x) subject to g(x) = 1. By hand the solution is (1/sqrt(

Re: [R] Function to Define a Function

2010-08-10 Thread Derek Ogle
Gabor ... that worked perfectly. Thank you. > -Original Message- > From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] > Sent: Monday, August 09, 2010 10:20 PM > To: Derek Ogle > Cc: R (r-help@R-project.org) > Subject: Re: [R] Function to Define a Function > > On Mon, Aug 9, 2010 a

[R] p-values with pvclust

2010-08-10 Thread syrvn
Hi, if you look at the first image (Image1) you see that there are 2 main clusters 7 and 8 I wanted to use pvclust to calculate a p-value whether these clusters are due to chance or statistically significant. Unfortunately pvclust does not provide a p-value for the first brunch (7 and 8). So I

[R] p-values with pvclust

2010-08-10 Thread syrvn
Hi, if you look at the first image (Image1) you see that there are 2 main clusters 7 and 8 I wanted to use pvclust to calculate a p-value whether these clusters are due to chance or statistically significant. Unfortunately pvclust does not provide a p-value for the first brunch (7 and 8). So I

Re: [R] R support for 64 bit integers

2010-08-10 Thread David Winsemius
On Aug 9, 2010, at 2:45 PM, Theo Tannen wrote: Are integers strictly a signed 32 bit number on R even if I am running a 64 bit version of R on a x86_64 bit machine? I ask because I have integers stored in a hdf5 file where some of the data is 64 bit integers. When I read that into R using

Re: [R] one (small) sample wilcox.test confidence intervals

2010-08-10 Thread peter dalgaard
On Aug 10, 2010, at 1:30 PM, Panos Hadjinicolaou wrote: > My questions (finally!) are: > > 1. Why the above warning for conf.lev = 0.99 does not appear for 0.93 < > conf.lev < 0.98 although it produces the same summary? > > 2. For conf.lev = 0.95, is there anything else I can do in order to

Re: [R] Replacing characters

2010-08-10 Thread Henrique Dallazuanna
Try this: library(RMySQL) #conn <- dbConnect(...) mysqlEscapeStrings(conn, "tes't") On Tue, Aug 10, 2010 at 3:02 AM, Orvalho Augusto wrote: > Hello guys! May be I am lazy but > > I need to replace a character like \ or ' or to escape them in a character > vector to write a SQL statement. > > Ho

[R] FAQ package, anyone?

2010-08-10 Thread baptiste Auguié
Dear list, Here's a reproducible example that fails, library(faq) Error in library(faq) : there is no package called 'faq' faq("lattice sweave") Error: could not find function "faq" As a fun challenge, I propose to remedy this by creating a fortune-like package dedicated to Frequently Asked Qu

Re: [R] Sweave with dev.new()

2010-08-10 Thread Marc Schwartz
On Aug 10, 2010, at 3:51 AM, Gro Nilsen wrote: > Dear list. > I am preparing a R package, and the last step is to write a package > vignette using Sweave. However, I am experiencing some trouble when trying > to include plots in my Sweave document. That is, in my package I have made > some plottin

Re: [R] Replacing characters

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 2:02 AM, Orvalho Augusto wrote: Hello guys! May be I am lazy but I need to replace a character like \ or ' or to escape them in a character vector to write a SQL statement. ?sub ?regex How can I do that? Caveman -- David Winsemius, MD West Hartford, CT ___

[R] alternative in morantest

2010-08-10 Thread elaine kuo
Dear list, I am learning moran.test in package spdep. There is a setting of alternative, defined as a character string specifying the alternative hypothesis, must be one of greater (default), less or two.sided. I would like to learn what a alternative hypothesis is in moran.test but found little

  1   2   >