Re: [R] relationship between t-test CI and SEM?

2008-03-09 Thread Daniel Nordlund
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf > Of Rob Campbell > Sent: Sunday, March 09, 2008 9:19 PM > To: r-help@r-project.org > Subject: [R] relationship between t-test CI and SEM? > > Hi, > > I have what is probably a stupid question but I'm confu

Re: [R] Help on vectorizing

2008-03-09 Thread Charles C. Berry
On Sun, 9 Mar 2008, Gabor Grothendieck wrote: > Try this: > > r <- unlist(sapply(x, function(x) c(rep(0, x), 1))) And in large problems ( length(x) >> 1000 ), this will be faster still r <- rep( rep( 0:1, length(x) ), rbind(x,1) ) HTH, Chuck > x2 <- diff(c(0, which(r==1))) - 1 > iden

[R] relationship between t-test CI and SEM?

2008-03-09 Thread Rob Campbell
Hi, I have what is probably a stupid question but I'm confused so here goes: - I have a distribution (n=100) and want to determine if the mean is significantly different from 0.5. - When I plot the 2-tailed 95% confidence limits for the standard error of the mean I find that the upper one just

Re: [R] source(echo=TRUE) bug (was: source() behavior I don't understand)

2008-03-09 Thread Richard M. Heiberger
Ok, I'll write something and try it out. Rich -Original Message- From: Duncan Murdoch [mailto:[EMAIL PROTECTED] > source() is pure R code, so if you want a function that behaves > differently, you can do it fairly easily yourself. __ R-help@r

Re: [R] source(echo=TRUE) bug (was: source() behavior I don't understand)

2008-03-09 Thread Duncan Murdoch
Richard M. Heiberger wrote: > Duncan, > > I would like an option for all comments and blanks to be echoed. The > reason is that I am designing a mechanism for connecting ESS to Rgui > using source(). It works for me now, but is not smooth enough to post > until I do a little bit more work on it.

Re: [R] source(echo=TRUE) bug (was: source() behavior I don't understand)

2008-03-09 Thread Richard M. Heiberger
Duncan, I would like an option for all comments and blanks to be echoed. The reason is that I am designing a mechanism for connecting ESS to Rgui using source(). It works for me now, but is not smooth enough to post until I do a little bit more work on it. Therefore I want an option for the R C

[R] ltm package question

2008-03-09 Thread Davood Tofighi
Hello All, I was wondering how I can get the overall Pearson chi^2 test of model fit with its df and p value in the LTM package for the 2PL models. Thanks, -- Davood Tofighi Department of Psychology Arizona State University [[alternative HTML version deleted]]

Re: [R] source(echo=TRUE) bug (was: source() behavior I don't understand)

2008-03-09 Thread Duncan Murdoch
On 09/03/2008 10:40 PM, Richard M. Heiberger wrote: > Thanks Duncan, > > While there, can you give a new optional argument that > will permit the echo of blanks and comments? Comments are already echoed, leading blank lines are not (but blanks in comments are). For example: > temp.ttt <- "ttt

Re: [R] source(echo=TRUE) bug (was: source() behavior I don't understand)

2008-03-09 Thread Richard M. Heiberger
Thanks Duncan, While there, can you give a new optional argument that will permit the echo of blanks and comments? Rich __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-proj

[R] source(echo=TRUE) bug (was: source() behavior I don't understand)

2008-03-09 Thread Duncan Murdoch
On 09/03/2008 10:01 PM, Richard M. Heiberger wrote: > temp.ttt <- "ttt <- 1\nttt" > conn.ttt <- textConnection(temp.ttt) > source(conn.ttt, echo=TRUE) ## name of variable is echoed > close(conn.ttt) > cat(file="c:/temp/temp.R", temp.ttt) ## name of variable not echoed > source("c:/temp/temp.R", e

Re: [R] source() behavior I don't understand

2008-03-09 Thread jim holtman
Put 'print' around your variable: > temp.ttt <- "ttt <- 1\nprint(ttt)" > conn.ttt <- textConnection(temp.ttt) > source(conn.ttt, echo=TRUE) ## name of variable is echoed > ttt <- 1 > print(ttt) [1] 1 > close(conn.ttt) > cat(file="c:/temp/temp.R", temp.ttt) ## name of variable not echoed > sour

[R] source() behavior I don't understand

2008-03-09 Thread Richard M. Heiberger
temp.ttt <- "ttt <- 1\nttt" conn.ttt <- textConnection(temp.ttt) source(conn.ttt, echo=TRUE) ## name of variable is echoed close(conn.ttt) cat(file="c:/temp/temp.R", temp.ttt) ## name of variable not echoed source("c:/temp/temp.R", echo=TRUE) temp.abc <- "abc <- 1\nabc" conn.abc <- textConnecti

Re: [R] question about matrix one column values matching a vector ofvalues

2008-03-09 Thread Bill.Venables
> a <- matrix (1:16, 4, 4) > b <- c (2,3) > > which(a[, 1] %in% b) [1] 2 3 > > a [,1] [,2] [,3] [,4] [1,]159 13 [2,]26 10 14 ## << [3,]37 11 15 ## << [4,]48 12 16 > Bill Venables CSIRO Laboratories PO Box 120, Cleveland, 4163 AUS

Re: [R] Help on vectorizing

2008-03-09 Thread Gabor Grothendieck
Try this: r <- unlist(sapply(x, function(x) c(rep(0, x), 1))) x2 <- diff(c(0, which(r==1))) - 1 identical(x, x2) On Sun, Mar 9, 2008 at 7:55 PM, remko duursma <[EMAIL PROTECTED]> wrote: > > Dear R-helpers, > > I have two problems that I don't know how to vectorize (but would like to > because m

[R] Help on vectorizing

2008-03-09 Thread remko duursma
Dear R-helpers, I have two problems that I don't know how to vectorize (but would like to because my current solution is slow). # 1. #I have a vector x: x <- c(3, 0, 1, 0, 2, 2, 2, 0, 4, 2) #I want this translated into a new vector based on x,so that each element of x #is the number of z

Re: [R] R-Logo in \LaTeX (Mag. Ferri Leberl)

2008-03-09 Thread AA
Jean, Thanks for this piece of Latex code. I did not have a pdf Rlogo and the tex command. AA. - Original Message - From: "Jean lobry" <[EMAIL PROTECTED]> To: Sent: Friday, March 07, 2008 11:08 AM Subject: Re: [R] R-Logo in \LaTeX (Mag. Ferri Leberl) > Dear Mag. Ferri Leberl, > > I'm u

Re: [R] question about matrix one column values matching a vector of values

2008-03-09 Thread Henrique Dallazuanna
Use %in% indeed of '==' a[a[,1] %in% b,] On 09/03/2008, Waverley <[EMAIL PROTECTED]> wrote: > Hi, > > I have a matrix > a = matrix (1:16, 4, 4) > b = c (2,3) > > I want to find out which rows of a, where a[,1] equals any values of b? > > I know that if b is only one value, e.g, b=2, then what I

Re: [R] transforming column of a dataframe by var- and median-functions

2008-03-09 Thread Henrique Dallazuanna
I think that your 'C' column is a factor(or character), because the character used(comma). One option: dat$C <- as.numeric(gsub(",", ".", as.character(dat$C))) library(doBy) summaryBy(C ~ B, data=dat, FUN=c(median, var), na.rm = T) On 09/03/2008, Agrarimmobilien <[EMAIL PROTECTED]> wrote: > H

[R] question about matrix one column values matching a vector of values

2008-03-09 Thread Waverley
Hi, I have a matrix a = matrix (1:16, 4, 4) b = c (2,3) I want to find out which rows of a, where a[,1] equals any values of b? I know that if b is only one value, e.g, b=2, then what I want is a[a[,1] == 2,] But what about if it is not one value but a vector of values? Thanks much in advance.

Re: [R] format numbers into percentages

2008-03-09 Thread Henrique Dallazuanna
Perhaps: sprintf("%g%%", x*100) On 09/03/2008, tom soyer <[EMAIL PROTECTED]> wrote: > Hi, > > I am currently using the following to formate numbers into percentages: > > x=0.00112 > paste(round(x*100,2),"%",sep="") > > I am wondering if there is a built in R function that does the same. Does > an

Re: [R] format numbers into percentages

2008-03-09 Thread Henrik Bengtsson
On Sun, Mar 9, 2008 at 3:36 PM, tom soyer <[EMAIL PROTECTED]> wrote: > Hi, > > I am currently using the following to formate numbers into percentages: > > x=0.00112 > paste(round(x*100,2),"%",sep="") My favorite is sprintf(), which allow you to control number of digits at the same time you cont

Re: [R] p-adjust using Benjamn and Hochberg

2008-03-09 Thread Christophe Lo
Hi David, thank you. Sorry, I will make sure it is clear next time. Chris On 3/9/08, David Winsemius <[EMAIL PROTECTED]> wrote: > > Keizer_71 <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > > > > Hello, > > > > I am trying to use the p.adjust function for multiple testing. > > > > h

[R] format numbers into percentages

2008-03-09 Thread tom soyer
Hi, I am currently using the following to formate numbers into percentages: x=0.00112 paste(round(x*100,2),"%",sep="") I am wondering if there is a built in R function that does the same. Does anyone know? Thanks, -- Tom [[alternative HTML version deleted]] _

[R] sampsize in Random Forests

2008-03-09 Thread Naiara Pinto
Hi all, I have a dataset where each point is assigned to a class A, B, C, or D. Each point is also assigned to a study site. Each study site is coded with a number ranging between 1-100. This information is stored in the vector studySites. I want to run randomForests using stratified sampling, so

Re: [R] box-constrained

2008-03-09 Thread Gustave Lefou
Hello everybody, I have another question. I have seen there is a function called "constrOptim" in R. Is it better than "optim", for example to optimize a function f of two parameters belonging to [0,1] and [0,Infinity] ? Do the methods supplied like Nelder-Mead are better than those of optim ?

Re: [R] transforming column of a dataframe by var- and median-functions

2008-03-09 Thread Daniel Malter
I think tapply does the job you want: tapply(C,B,mean,na.rm=TRUE) tapply(C,B,var,na.rm=TRUE) Cheers, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Agrarimm

[R] transforming column of a dataframe by var- and median-functions

2008-03-09 Thread Agrarimmobilien
Hello, I try to transform a data frame like ABC 112,5 22NA 311,0 4156 5223 61NA 7246 to the following dataframe, calculating the variance and median of the C-column,

[R] Matrix Row name Compatibility

2008-03-09 Thread Charles Willis
Hello, I am trying to preform a comparative analysis using the partial mantel method. However, i am having trouble creating compatible matrices. I can create matrices from my numerical data using the 'distance(x, method)' function from ecodist, but the row/column names are out put as numbers. Whil

Re: [R] Calling plot with a formula, from within a function, using ..., and xlim

2008-03-09 Thread Charilaos Skiadas
On Mar 9, 2008, at 1:29 PM, Prof Brian Ripley wrote: > You should make a habit of using of R's debugging tools, e.g. > traceback() which gives > >> traceback() > 6: eval(expr, envir, enclos) > 5: FUN(X[[1L]], ...) > 4: lapply(dots, eval, data, parent.frame()) > 3: plot.formula(k ~ j, data = obj,

[R] Weighted means in aggregate.table

2008-03-09 Thread smith_cc
I need to calculate the weighted means by two factors, the subject id and the time of measurement. I was hoping to use aggregate.table, but this function does not allow me to use different weights for each mean that is calculated. id <- c(rep("a",4),rep("b",4)) time <- c(0,0,60,60,0,0,60,60) y <

[R] [ca package] how to extract x,y from mjca function

2008-03-09 Thread popiel
Hi, I would like to extract x,y from mjca function in ca package to be able to draw other graph types. For example for simple mca function from MASS I can do the following: - mydata.mca <- mca(anydata, nf = 2, abbrev = TRUE) x <- anydata.mca$rs[,1]#that is what I can 'extract'

Re: [R] p-adjust using Benjamn and Hochberg

2008-03-09 Thread David Winsemius
Keizer_71 <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > Hello, > > I am trying to use the p.adjust function for multiple testing. > > here is what i have > > 9997201674_s_at 0.327547396 > 9998221013_s_at 0.834211067 > 221685_s_a

Re: [R] question for crosstable

2008-03-09 Thread eugen pircalabelu
Yes, Mark! Thank you! I was repeatedly using the function with two vectors and i have forgotten that it could be used also with a matrix. Thank you once again! Marc Schwartz <[EMAIL PROTECTED]> wrote: eugen pircalabelu wrote: > Good evening R-users! > > I have the following problem: i want t

Re: [R] p-adjust using Benjamn and Hochberg

2008-03-09 Thread Charles C. Berry
On Sun, 9 Mar 2008, Keizer_71 wrote: > > Hello, > > I am trying to use the p.adjust function for multiple testing. > > here is what i have > > 9997201674_s_at 0.327547396 > 9998221013_s_at 0.834211067 > 221685_s_at 0.185099475 > > I import the

Re: [R] question for crosstable

2008-03-09 Thread Marc Schwartz
eugen pircalabelu wrote: > Good evening R-users! > > I have the following problem: i want to get a weighted crosstable along with > the adjusted standardized residuals test > > Example: > a<-c(1,1,1,1,1,2,2,2,3,3) > b<-c(10,10,23,24,33,45,46,70,21,66) > c<-c(3,3,2,3,4,1,1,1,3,3) > d<-c("a",

[R] p-adjust using Benjamn and Hochberg

2008-03-09 Thread Keizer_71
Hello, I am trying to use the p.adjust function for multiple testing. here is what i have 9997201674_s_at 0.327547396 9998221013_s_at 0.834211067 221685_s_at 0.185099475 I import them from excel have have the gene symbol as well as the pva

[R] question for crosstable

2008-03-09 Thread eugen pircalabelu
Good evening R-users! I have the following problem: i want to get a weighted crosstable along with the adjusted standardized residuals test Example: a<-c(1,1,1,1,1,2,2,2,3,3) b<-c(10,10,23,24,33,45,46,70,21,66) c<-c(3,3,2,3,4,1,1,1,3,3) d<-c("a", "b","b","c","a","a","a", "b", "c","c") z<-da

Re: [R] Calling plot with a formula, from within a function, using ..., and xlim

2008-03-09 Thread Prof Brian Ripley
You should make a habit of using of R's debugging tools, e.g. traceback() which gives > traceback() 6: eval(expr, envir, enclos) 5: FUN(X[[1L]], ...) 4: lapply(dots, eval, data, parent.frame()) 3: plot.formula(k ~ j, data = obj, ...) 2: plot(k ~ j, data = obj, ...) 1: plotw(df, xlim = c(0, 4)) s

Re: [R] R error: Not able to launch R 2.6.2

2008-03-09 Thread Christophe Lo
Yes. I found one that says to change the extension to RData. Where is the folder located? I tried looking at the R folder but couldn't find it. On 3/9/08, Charilaos Skiadas <[EMAIL PROTECTED]> wrote: > > On Mar 9, 2008, at 12:12 PM, Keizer_71 wrote: > > > > > Hi Everyone, > > > > I am having troub

Re: [R] R error: Not able to launch R 2.6.2

2008-03-09 Thread Duncan Murdoch
On 09/03/2008 12:12 PM, Keizer_71 wrote: > Hi Everyone, > > I am having trouble using R. I am not sure what happen but when i start R, i > am getting error message > > "Fatal Error: Unable to restore saved data in .RData. > > -I restarted my pc but still same error > -I reinstall R but still sa

Re: [R] R error: Not able to launch R 2.6.2

2008-03-09 Thread Charilaos Skiadas
On Mar 9, 2008, at 12:12 PM, Keizer_71 wrote: > > Hi Everyone, > > I am having trouble using R. I am not sure what happen but when i > start R, i > am getting error message > > "Fatal Error: Unable to restore saved data in .RData. Just google for "unable to restore saved data in .RData. ", and

[R] R error: Not able to launch R 2.6.2

2008-03-09 Thread Keizer_71
Hi Everyone, I am having trouble using R. I am not sure what happen but when i start R, i am getting error message "Fatal Error: Unable to restore saved data in .RData. -I restarted my pc but still same error -I reinstall R but still same error -deleted the R folder and have a fresh re-install

[R] Calling plot with a formula, from within a function, using ..., and xlim

2008-03-09 Thread Charilaos Skiadas
I ran into a weird, to me at least, problem, and hoping someone can shed some light into it. In a nutshell, there seems to be some problem when one calls plot with a formula, from within another function, using ... to pass arguments, and one of those arguments being xlim (and only xlim show

[R] Bessel functions of complex argument

2008-03-09 Thread baptiste Auguié
Dear R users, I'm porting a piece of Matlab code to R, but I'm now stuck with the following: I need an equivalent of besselJ(x, nu) that can handle a complex argument x. I couldn't find any R implementation. I did find a possible fortran solution in SLATEC (< http://www.netlib.org/slatec/

Re: [R] Two sample t-test

2008-03-09 Thread michael watson (IAH-C)
Why are you using "skip=2"? Try: read.csv(""c://test.csv",header="T",eomment.char="") -Original Message- From: [EMAIL PROTECTED] on behalf of Claire_6700 Sent: Sun 09/03/2008 12:55 PM To: r-help@r-project.org Subject: [R] Two sample t-test Hi, I want to perform t-test in R for each

Re: [R] Formula for whether hat value is influential?

2008-03-09 Thread John Fox
Dear Gavin and Paul, (k + 1)/n is the average hatvalue. The 2(k + 1)/n rule comes from results in Belsley, Kuh, and Welsch (1980), Regression Diagnostics, concerning the distribution of the hatvalues when n is large relative to k + 1, and when X is multivariate normal. For smaller n, this tends to

Re: [R] help

2008-03-09 Thread Mark Wardle
I don't really understand your question, but try this: http://www.econ.uiuc.edu/~roger/research/links/Rnews.pdf http://cran.r-project.org/web/packages/VGAM/NEWS Try typing cauchit into rseek.org In addition, follow the references in the help page in VGAM cauchit help page. Best wishes, Mark

[R] Two sample t-test

2008-03-09 Thread Claire_6700
Hi, I want to perform t-test in R for each individual car. Here is what i have. Is there a way i can test each car? The original table (test.csv) Car Tester2 Tester2 Controller1 Controller2 Audi0.560.9 0.5 0.9 Toyota 0.2 0.9 0.9 0.2 Honda 0.5 0.9

Re: [R] Finding Interaction and main effects contrasts for two-wayANOVA

2008-03-09 Thread Chuck Cleland
On 3/8/2008 3:05 PM, Dale Steele wrote: > Thanks to those who have replied to my original query. However, I'm > still confused on how obtain estimates, standard error and F-tests for > main effect and interaction contrasts which agree with the SAS code > with output appended below. > > for exampl

Re: [R] How to plot raster obtained from readRAST6 in grey scale?

2008-03-09 Thread Rainer M Krug
Thanks - I was quite in a rush when writing the question - sorry about that. But it works now with image(TheImage, col=gray.colors(10, start=0.9, end=0.3) On 08/03/2008, Roger Bivand <[EMAIL PROTECTED]> wrote: > Uwe Ligges statistik.tu-dortmund.de> writes: > > > > > > > Rainer M Krug wrote:

Re: [R] Legend names

2008-03-09 Thread Uwe Ligges
Joaquim J. S. Ramalho wrote: > Hi, > > I need to use greek symbols in a legend. When I write: > > a <- 1 > leg.names <- as.expression(substitute(alpha==p,list(p=a))) > legend("bottomright",legend=leg.names,lty=1) > > everything works fine. However, I want alpha=lambda=1. Therefore, I wrote: >

Re: [R] Formula for whether hat value is influential?

2008-03-09 Thread Gavin Simpson
On Sat, 2008-03-08 at 19:38 -0800, Paul Lynch wrote: > I was wondering if someone might be able to tell me what formula R's > influence.measures function uses for determining whether the hat value > it computes is influential (i.e., the true/false value in the "hat" > column of the returned is.inf

[R] Legend names

2008-03-09 Thread Joaquim J. S. Ramalho
Hi, I need to use greek symbols in a legend. When I write: a <- 1 leg.names <- as.expression(substitute(alpha==p,list(p=a))) legend("bottomright",legend=leg.names,lty=1) everything works fine. However, I want alpha=lambda=1. Therefore, I wrote: leg.names <- as.expression(substitute(alpha==lambd