Re: [R] Multivariate Outlier Detection - Robust

2007-05-13 Thread Dieter Menne
Fiona Sammut um.edu.mt> writes: > Whilst reading a book on robust statistics, in particular a section on > multivariate outlier detection, I came across the functions outmve, > outmgv and outpro. I tried the help.search command to try and find > documentation on these 3 commands in R. I also

[R] Conditional Sums for Index creation

2007-05-13 Thread Patnaik, Tirthankar
Hi, Apologies for the long mail. I have a data.frame with columns of price/mcap data for a portfolio of stocks, and the date. To get the total value of the portfolio on a daily basis, I calculate rowSums of the data.frame. > set.seed(1) > ab <- matrix(round(runif(100)*100),nrow=20,ncol=5)

Re: [R] Nicely formatted summary table with mean, standard deviation or number and proportion

2007-05-13 Thread Keith Wong
Prof Harrell Thanks for the hint! I am using Hmisc 3.3-2, on R version 2.5.0 with windows XP. I saw the argument "prmsd = T" in the help for summary.formula(), and couldn't understand how to make it work, but just now realised that it should be applied to the latex() function, and not to summa

Re: [R] Nicely formatted summary table with mean, standard deviation or number and proportion

2007-05-13 Thread Frank E Harrell Jr
Keith Wong wrote: > Dear all, > > The incredibly useful Hmisc package provides a method to generate > summary tables that can be typeset in latex. The Alzola and Harrell book > "An introduction to S and the Hmisc and Design libraries" provides an > example that generates mean and quartiles fo

[R] Nicely formatted summary table with mean, standard deviation or number and proportion

2007-05-13 Thread Keith Wong
Dear all, The incredibly useful Hmisc package provides a method to generate summary tables that can be typeset in latex. The Alzola and Harrell book "An introduction to S and the Hmisc and Design libraries" provides an example that generates mean and quartiles for continuous variables, and n

Re: [R] Predicted values from a logistic model

2007-05-13 Thread Frank E Harrell Jr
MANASI VYDYANATH wrote: > Hello - > > I apologize if this question is simple/obvious, but I couldn't find a > satisfactory answer online, and I am not very accustomed to working > with R (Matlab is my poison. :-)). Any help would be greatly > appreciated. > > I have a model with a three-lev

[R] Predicted values from a logistic model

2007-05-13 Thread MANASI VYDYANATH
Hello - I apologize if this question is simple/obvious, but I couldn't find a satisfactory answer online, and I am not very accustomed to working with R (Matlab is my poison. :-)). Any help would be greatly appreciated. I have a model with a three-level factor and a continuous covariate.

Re: [R] factanal

2007-05-13 Thread Bill.Venables
Soare Marcian-Alin asks > Sent: Monday, 14 May 2007 7:34 AM > To: R-help@stat.math.ethz.ch > Subject: [R] factanal > > Hello Guys, ... and the gals, I presume. > I have problem with the factanal function, I dont understand why it tells me > everytime "2 factors is too many for 3 variables" It

Re: [R] mtrace() fails

2007-05-13 Thread Norm Matloff
Thanks to both of you for replying. Actually, I first wrote Mark, but he had a vacation mail message saying he'll be away until the 22nd, and I wanted my students to be able to use this debugging tool before then. R-2.5.0-patched did indeed solve the problem. Thanks. By the way, I have (yet an

Re: [R] extracting text contained in brackets ("[ ... ]") from a character string?

2007-05-13 Thread Gabor Grothendieck
If you know its of the form testdata[3] then this is sufficient x <- c("testdata[3]", "testdata[-4]", "testdata[-4g]") gsub(".*\\[|\\]", "", x) # c("3", "-4", "-4g") Here is a somewhat more general solution: library(gsubfn) x <- c("a[b]c[d]d", "[a]b") strapply(x, "\\[([^]]*)\\]", back

[R] Error in dimnames(x) <- dn

2007-05-13 Thread Ozlem Ipekci
Hi everyone, I import data from access, and make an object (c) store the data, when I want to use it in function mnp, it gives the below error: Error in dimnames(x) <- dn : length of 'dimnames' [2] not equal to array extent > x<-odbcConnectAccess("db2.mdb") > c<-sqlFetch(x,"Sheet2") > odbcClose(

Re: [R] extracting text contained in brackets ("[ ... ]") from a character string?

2007-05-13 Thread jim holtman
here is one way using 'sub': > x <- c("testdata[3]", "testdata[-4]", "testdata[-4g]") > sub(".*\\[(.*)\\].*", "\\1", x, perl=TRUE) [1] "3" "-4" "-4g" > x.func <- function(x){ sub(".*\\[(.*)\\].*", "\\1", x, perl=TRUE)} > x.func(x) [1] "3" "-4" "-4g" > On 5/13/07, new ruser <[EMAIL PROTECTE

[R] factanal

2007-05-13 Thread Soare Marcian-Alin
Hello Guys, I have problem with the factanal function, I dont understand why it tells me everytime "2 factors is too many for 3 variables" data set: http://www.statistik.tuwien.ac.at/public/filz/students/multi/ss07/world2.R code: library(robustbase) source("world2.R") str(world) # structure su

[R] Mclust help

2007-05-13 Thread A Das
Hi, quick question from a social scientist new to R: how do I add labels/row names to the nodes in coordProj / plot.Mclust plots? Apologies if this is a silly question... Thanks. -- Bobby ___

[R] extracting text contained in brackets ("[ ... ]") from a character string?

2007-05-13 Thread new ruser
I have a text string that contains text within two brackets. e.g. "testdata[3]" "testdata[-4]", "testdata[-4g]", I wish to "extract" the string enclosed in brackets? What is a good way to do this? e.g. fun(testdata[3]) = '3' fun(testdata[-4g]) = '-4g' -

[R] Multivariate Outlier Detection - Robust

2007-05-13 Thread Fiona Sammut
Dear all, Whilst reading a book on robust statistics, in particular a section on multivariate outlier detection, I came across the functions outmve, outmgv and outpro. I tried the help.search command to try and find documentation on these 3 commands in R. I also searched online, but no to a

[R] Mclust node labels

2007-05-13 Thread A Das
Hi, A quick question from a social scientist new to R - how do I get coordProj / plot.Mclust to label the nodes by row names? Using "identify" only gives me the row numbers... Thanks. -- Bobby __ R-help@stat.math.ethz.ch mailing list htt

[R] confidence intervals on multiple comparisons

2007-05-13 Thread Salvatore Enrico Indiogine
Greetings! I am using prop.test to compare 4 proportions to find out whether they are equal. According to the help function you can not have confidence intervals if you compare more than 2 proportions. I need to find an effect size or confidence interval for these proportions. Any suggestions?

Re: [R] Oddities upgrading from 2.4.1 to 2.5.0

2007-05-13 Thread Prof Brian Ripley
You are confusing binary packages available for a version of R for Windows, and source packages. But 'stats4' is not on CRAN. On Sun, 13 May 2007, Chris Evans wrote: > I'm working on Windoze XP and have for some time installed R in D:\R and > upgraded my packages after installing the new versio

Re: [R] Some questions on repeated measures (M)ANOVA & mixed models with lme4

2007-05-13 Thread Peter Dalgaard
Marco B wrote: > Dear R Masters, > > I'm an anesthesiology resident trying to make his way through basic > statistics. Recently I have been confronted with longitudinal data in > a treatment vs. control analysis. My dataframe is in the form of: > > subj | group | baseline | time | outcome (long) >

Re: [R] Oddities upgrading from 2.4.1 to 2.5.0

2007-05-13 Thread Gabor Grothendieck
Using movedir.bat or copydir.bat from batchfiles: http://code.google.com/p/batchfiles/ you can move or copy your old packages over to the new R tree. It won't overwrite any so you can do that even after you have installed some by some other method such as that you describe below. Once you have m

[R] Oddities upgrading from 2.4.1 to 2.5.0

2007-05-13 Thread Chris Evans
I'm working on Windoze XP and have for some time installed R in D:\R and upgraded my packages after installing the new version of R with a bit of code I think I got from the list: ip <- installed.packages(lib.loc = "d:\\R\\R-2.4.1\\library") ip <- ip[ip[,1]!="base" ,1] install.packages(ip) This t

Re: [R] Some questions on repeated measures (M)ANOVA & mixed modelswith lme4

2007-05-13 Thread John Fox
Dear Marco, You might also take a look at ?Anova (or ?Manova) in the car package; the last examples are for a repeated-measures ANOVA using both MANOVA and univariate approaches, the latter with GG and HF corrections. I hope this helps, John John Fox, Professor

[R] Some questions on repeated measures (M)ANOVA & mixed models with lme4

2007-05-13 Thread Marco B
Dear R Masters, I'm an anesthesiology resident trying to make his way through basic statistics. Recently I have been confronted with longitudinal data in a treatment vs. control analysis. My dataframe is in the form of: subj | group | baseline | time | outcome (long) or subj | group | baseline |

Re: [R] Newbie's question

2007-05-13 Thread Gabor Grothendieck
On 5/13/07, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Sun, 13 May 2007, Sarah Goslee wrote: > > > Sure, R can do anything. The first trick, though, is to learn > > how to write clear-enough questions to the mailing list > > that you get helpful answers back. A worked example of > > what you

Re: [R] Biplot

2007-05-13 Thread Prof Brian Ripley
The PCA of two variables out of three is unrelated to the PCA of all three, so your example code does not do what you describe. If you want to plot two of the components of a full PCA, see ?biplot.princomp: and note that it says this is not a true biplot for other than the first two components.

Re: [R] Newbie's question

2007-05-13 Thread Prof Brian Ripley
On Sun, 13 May 2007, Sarah Goslee wrote: > Sure, R can do anything. The first trick, though, is to learn > how to write clear-enough questions to the mailing list > that you get helpful answers back. A worked example of > what you want would be very useful, since I have no idea > what the index is

Re: [R] Newbie's question

2007-05-13 Thread Sarah Goslee
Sure, R can do anything. The first trick, though, is to learn how to write clear-enough questions to the mailing list that you get helpful answers back. A worked example of what you want would be very useful, since I have no idea what the index is, or what field2 is, or what kind of graph you want.

Re: [R] how to convert a string vector to a numeric vector

2007-05-13 Thread Charilaos Skiadas
On May 13, 2007, at 7:48 AM, Mihai Bisca wrote: > Hello all, > > I'm new to R and I cannot find a simple answer to a simple question. > If I have a character vector like v <- c('1/50,'1/2','1/8'...) how can > I convert it to a numeric vector like vn <- c(0.02,0.5,0.125...). I > tried as.numeric i

Re: [R] Biplot

2007-05-13 Thread Sarah Goslee
Hi, If you check the help for princomp, you'll see that it returns all sorts of information in the form of a list. The most convenient way is to save your analysis xresults <- princomp(x, cor=TRUE) then you can look at the scores, plot them yourself, anything else you want xscores <- xresults$scor

[R] how to convert a string vector to a numeric vector

2007-05-13 Thread Mihai Bisca
Hello all, I'm new to R and I cannot find a simple answer to a simple question. If I have a character vector like v <- c('1/50,'1/2','1/8'...) how can I convert it to a numeric vector like vn <- c(0.02,0.5,0.125...). I tried as.numeric in various ways and failed miserably. Currently I use a functi

[R] object class for triangles

2007-05-13 Thread Ember Kata
My task is to create an object class for triangles. I have made a function: triangle<- function(a,b,gamma) { c <- sqrt (a^2+b^2-2*a*b*cos(gamma/180*pi)) beta <- (acos((a^2+c^2-b^2)/(2*a*c)))/pi*180 alfa <- 180-(beta+gamma) T <- (a*b*sin(gamma/180*pi))/2 K <- a+b+c cat ('side of triangle: ',a,b,c,

Re: [R] [OT] Is data copyrightable?

2007-05-13 Thread hadley wickham
These links from the US copyright office seem relevant: "Copyright Registration for Automated Databases" http://www.copyright.gov/circs/circ65.html and "Furthermore, copyright protection does not extend to works consisting entirely of information that is common property containing no original au

Re: [R] [OT] Is data copyrightable?

2007-05-13 Thread hadley wickham
Dear Brian, Peter, Spencer, Thanks for your comments, which have cleared things up a little for me. The thing I find most confusing about copyright is that it is emergent, not atomic - ie. if you split a copyrighted work into small enough pieces (eg. letters, pixels) those pieces are no longer co

[R] [OT] Is data copyrightable?

2007-05-13 Thread Michael Sumner
A relevant book on this important (and evolving) topic is Math You Can't Use: Patents, Copyright, and Software by Ben Klemens (2006) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide