Re: [R] OLS standard errors

2008-02-26 Thread Prof Brian Ripley
Please check your statistical methods lecture notes. var(e) has divisor n-1, and that is not an unbiased estimator of the residual variance when 'e' are residuals. From summary.lm (and you are allowed to read the code) rdf <- n - p if (is.na(z$df.residual) || rdf != z$df.residual)

Re: [R] OLS standard errors

2008-02-26 Thread Viechtbauer Wolfgang (STAT)
Try multiplying var(e) by n-1 and dividing by n-3 (97 are the degrees of freedom for the sum of squares error in your example). Then it all matches up nicely. Best, -- Wolfgang Viechtbauer  Department of Methodology and Statistics  University of Maastricht, The Netherlands  http://www.wvbauer.

[R] anova repeated measure

2008-02-26 Thread guillaume chaumet
Dear R people, I'm new user of R and I'm trying to do a Anova with 3 different tests (intra subject), 6 times of measures (intra subject) and 3 groups (inter subject). I want to obtain an Huynh-Feldt epsilon on accuracy with: >anova(lm(acc.t1~gr.dem),test="Spherical") for test 1 # gr.dem is my grou

[R] Split data.frames depeding values of a column

2008-02-26 Thread Knut Krueger
Hello to all is there a function wich splits a data.frame (column1,column2,column3,) into data1 <-(column1,column3) #column2 = 1 data2 <-(column1,column3) #column2 = 2 data3 <-(column1,column3) #column2 = 3 ... Regards Knut __ R-help@r-

Re: [R] Split data.frames depeding values of a column

2008-02-26 Thread Dimitris Rizopoulos
try split(), e.g., dat <- data.frame(x = rnorm(12), y = runif(12), z = rep(1:4, 3)) dat split(dat[1:2], dat$z) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leu

Re: [R] How to include the documentation of a function in a Sweave document?

2008-02-26 Thread Duncan Murdoch
On 26/02/2008 5:30 AM, Thibaut Jombart wrote: > Jean lobry wrote: >> Dear R-help, >> >> I would like to include the documentation of an R function in an >> *.rnw document processed by Sweave. Because I'm sharing my *.rnw >> files with colleagues under Linux and Windows (I'm on Mac OS X), >> I would

Re: [R] How to include the documentation of a function in a Sweave document?

2008-02-26 Thread Thibaut Jombart
Jean lobry wrote: > Dear R-help, > > I would like to include the documentation of an R function in an > *.rnw document processed by Sweave. Because I'm sharing my *.rnw > files with colleagues under Linux and Windows (I'm on Mac OS X), > I would like a pure R solution. > > The naive approach doesn'

Re: [R] Split data.frames depeding values of a column

2008-02-26 Thread Knut Krueger
Dimitris Rizopoulos schrieb: > > I hope it helps. yes, thank's a lot Knut __ 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 commente

[R] graphics of profile in longitudinal data

2008-02-26 Thread Luis Guillermo Diaz Monroy
I want to obtain a tool to draw, with R, the profiles associated with longitudinal or repeated measures data. Thanks a lot, Luis Guillermo Díaz Monroy Profesor Asociado Departamento de Estadística Universidad Nacional de Colombia ¡+!: Para comodidad en la recepcion este

Re: [R] Avoiding overplotting of text.

2008-02-26 Thread Gustaf Rydevik
On Mon, Feb 25, 2008 at 10:36 PM, hadley wickham <[EMAIL PROTECTED]> wrote: > > I am plotting some data, and use text() to get variable names next to > > points on the graph. What is the best way to make sure that these text > > labels are readable and not overlapping when two datapoints are c

[R] Help needed to analyse a factorial microarray experiments! Newbie Question

2008-02-26 Thread Leonardo Boava
Dear R-users: I am using the package MAANOVA to analyze microarray data and have encountered problems when trying to get interactions. I am a newbie in both, R and maanova, and I do not have good knowledge in statistical methods. I have four effects: Effects Levels Var 2 Ind 2 Trat

Re: [R] How to include the documentation of a function in a Sweave document?

2008-02-26 Thread Thibaut Jombart
Duncan Murdoch wrote: >>> >> Maybe a clue: we can use >> cat(readLines(as.character(?plot)),sep="\n") >> >> to display the help (here, of plot) directly to the screen. So we could >> use something like: >> >> <>= >> ?plot >> @ >> >> >> <>= >> cat(readLines(as.character(?plot)),sep="\n") >> @ >>

[R] Generalized additive model regression with lag

2008-02-26 Thread Zergio Ibarra
Hi everyone I'm trying to do a semiparametric regression using generalized additive models (mgcv) with lags of the parameter. Does any of you know a package or a methodology for introducing the lags into the model? Thank you very much Sergio Ibarra Espinosa National Center of Environment Techn

[R] AIC and anova, lme

2008-02-26 Thread Patrick Giraudoux
Dear listers, Here we have a strange result we can hardly cope with. We want to compare a null mixed model with a mixed model with one independent variable. > lmmedt1<-lme(mediane~1, random=~1|site, na.action=na.omit, data=bdd2) > lmmedt9<-lme(mediane~log(0.0001+transat), random=~1|site, na.

[R] Combining series of variables using identifier

2008-02-26 Thread Lauri Nikkinen
R users, I have df like this a <- data.frame(indx =1:20, var1 =rep(c("I20", "I40", "A50", "B60"), each=5), var1_lab= rep(c("cat", "dog", "mouse", "horse"), each=5), var2 =rep(c("B20", "X40", "D50", "G60"), each=5),

Re: [R] AIC and anova, lme

2008-02-26 Thread ian white
Patrick, The likelihoods of two models fitted using REML cannot be compared unless the fixed effects are the same in the two models. On Tue, 2008-02-26 at 14:38 +0100, Patrick Giraudoux wrote: > Dear listers, > > Here we have a strange result we can hardly cope with. We want to > compare a n

Re: [R] How to include the documentation of a function in a Sweave document?

2008-02-26 Thread Henrique Dallazuanna
You can use '\include' also: \documentclass{article} \begin{document} \include{/usr/local/lib/R/library/graphics/latex/plot} %file.path(system.file(package="graphics"), "latex", "plot") \end{document} I don't know if there is a way of input file.path in include by Sweave. On 25/02/2008, Jean

Re: [R] AIC and anova, lme

2008-02-26 Thread Patrick Giraudoux
ian white a écrit : Patrick, The likelihoods of two models fitted using REML cannot be compared unless the fixed effects are the same in the two models. Many thanks for this reminder. Shame on me: it recalls me that this subject may have been already largely discussed on this list. Now, I

Re: [R] AIC and anova, lme

2008-02-26 Thread Dieter Menne
Patrick Giraudoux univ-fcomte.fr> writes: > > Dear listers, > > Here we have a strange result we can hardly cope with. We want to > compare a null mixed model with a mixed model with one independent > variable. > > > lmmedt1<-lme(mediane~1, random=~1|site, na.action=na.omit, data=bdd2) > >

[R] predict.rpart question

2008-02-26 Thread Damian Krstajic
Dear All, I have a question regarding predict.rpart. I use rpart to build classification and regression trees and I deal with data with relatively large number of input variables (predictors). For example, I build an rpart model like this rpartModel <- rpart(Y ~ X, method="class", minsplit =

Re: [R] Combining series of variables using identifier

2008-02-26 Thread K. Elo
Hi, if the columns always follow the same order (indx,var#, var#_lab ...), then You could use the column numbers and do the following: 1) CN<-colnames(df)[#] (#=colnum of 'var#') 2) df$NEW<-(here the expression to create the new variable) 3) colnames(df)[ncol(df)]<-c(paste(CN,"new",sep="_")) Th

Re: [R] Combining series of variables using identifier

2008-02-26 Thread Henrique Dallazuanna
Try this: foo <- function(data, ...) { patt <- grep("var[0-9]$", names(data), value=T) res <- paste(sapply(data[, patt], as.character), sapply(data[, paste(patt, "lab", sep="_")], as.character), sep=": ") cbind(a, matrix(res, ncol=length(patt), dimnames=list(NULL, paste(patt, "new", sep="_" }

[R] combine vector and data frame on field?

2008-02-26 Thread Karin Lagesen
I have managed to create a data frame like this: > tsus_same_mean[1:10,] PIDGrpDist PercAlnPercId 1 12638 Acidobacteria 0.0 1.000 1.000 2 87 Actinobacteria 0.0 0.970 0.970 3 92 Actinobacteria 0.008902000 1.000 0.991

[R] Rcmdr importing excel files

2008-02-26 Thread stephen sefick
I am using R 2.6.2 on Mac OS X 10.4.9- I would like to import excel files into R with Rcmdr, but This option does not present itself in the file menu. Any help would be greatly appreciated. Stephen -- Let's not spend our time and resources thinking about things that are so little or so large t

[R] predict.rpart question

2008-02-26 Thread Damian Krstajic
Dear All, I have a question regarding predict.rpart. I use rpart to build classification and regression trees and I deal with data with relatively large number of input variables (predictors). For example, I build an rpart model like this rpartModel <- rpart(Y ~ X, method="class", minsplit =1, m

Re: [R] combine vector and data frame on field?

2008-02-26 Thread Henrique Dallazuanna
Try this: merge(tsus_same_mean, as.data.frame(tsuPIDCount), by.x="PID", by.y=0) On 26/02/2008, Karin Lagesen <[EMAIL PROTECTED]> wrote: > > I have managed to create a data frame like this: > > > > tsus_same_mean[1:10,] > PIDGrpDist PercAlnPercId > 1 12638 Acid

[R] action executing twice while loading tiles

2008-02-26 Thread arun kumar
*hi I aam facing following problem my action executing twice when i try to load the tileslayout page as actionforward success * [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

[R] R package to perform Horn's parallel analysis

2008-02-26 Thread Karen Douglas
I am seeking information on whether anyone has written code to perform Horn's parallel analysis (a procedure that informs the selection of the proper number of components in PCA) in R. Thank you in advance for any help you can provide. Please respond off-list at the email address below. Karen

Re: [R] R package to perform Horn's parallel analysis

2008-02-26 Thread Paul Hewson
Dear Karen, You should find the code you want in the package paran: http://cran.r-project.org/web/packages/paran/index.html And you may be interested in looking at the Multivariate Cran Task view which attempts to catalogue these kinds of things: http://cran.r-project.org/web/views/Multivariate.

Re: [R] R package to perform Horn's parallel analysis

2008-02-26 Thread Stéphane Dray
ade4 has the "testdim" function which implements the method proposed in: *S. Dray*. On the number of principal components: A test of dimensionality based on measurements of similarity between matrices. /Computational Statistics and Data Analysis/, 52:2228-2237, 2008. Cheers, Karen Douglas wro

Re: [R] R package to perform Horn's parallel analysis

2008-02-26 Thread William Revelle
see fa.parallel in the psych package At 7:27 AM -0800 2/26/08, Karen Douglas wrote: >I am seeking information on whether anyone has written code to perform >Horn's parallel analysis (a procedure that informs the selection of the >proper number of components in PCA) in R. > > > >Thank you in advan

[R] Getting Stangle to tangle Sexpr expressions

2008-02-26 Thread Michael Hoffman
Is there a way to get Stangle to print out Sexpr expressions as well as code chunks? I am using weaver and when trying to debug Sweave files, it is sometimes difficult to figure out where the error is. The errors are hardest to find when they are in Sexpr expressions because stepping through th

[R] Custom LaTeX tables

2008-02-26 Thread Werner Wernersen
Hello, I am very happy that I have Sweave and R to write my papers. But I still have to do some tables by hand since I have not found out how I can customize the latex tables produced by R further (I mainly use xtable()). Like for instance, I have a table which needs an extra row every few rows as

[R] looping with a dynamic variable

2008-02-26 Thread Abi Ghanem josephine
Hi, i am trying to do a small job but it's bugging and i don't know what's happening. let's say i have four matrix, M01_a, M02_a, M01_b, M02_b that looks like this col1 col2 1 20 2 25 3 26 4 30 5 35 6 64 7 75 8 80 9 85

Re: [R] Custom LaTeX tables

2008-02-26 Thread Dieter Menne
Werner Wernersen yahoo.de> writes: > I am very happy that I have Sweave and R to write my > papers. But I still have to do some tables by hand > since I have not found out how I can customize the > latex tables produced by R further (I mainly use > xtable()). Like for instance, I have a table whi

Re: [R] projection.matrix() {popbio} for more than one matrix

2008-02-26 Thread Michelle DePrenger-Levin
Hello, I am trying to use the projection.matrix( ) function and am following the example given. I have my data formatted very similar to the test.census example. > str(AsMi05mat) `data.frame': 1854 obs. of 6 variables: $ Tag : num 501 502 503 504 505 506 507 508 509 510 ...

[R] wrapper for save function

2008-02-26 Thread Erik Iverson
Hello - I would like to create a wrapper to the 'save' function in the base package, but have a small problem with the name of the object that is getting saved in the file. Below is a simple example illustrating my problem. ## BEGIN SAMPLE R CODE #

[R] GLM

2008-02-26 Thread Dani Valverde
Hello, I am trying to perform a glm analysis on a 68x13113 matrix (named data.spect). The first column corresponds to the predictor (data.spect[,1]) and the rest to the response variables (data.spect[,2:13113]). When I try this code glmObject <- glm(data.spect[,2:13113]~data.spect[,1]) I get t

Re: [R] wrapper for save function

2008-02-26 Thread Erik Iverson
Of course the second this showed up on R-help, I got rid of the formal argument 'mydata' and just used ..., which seems to have solved the problem. Erik Erik Iverson wrote: > Hello - > > I would like to create a wrapper to the 'save' function in the base > package, but have a small problem wit

[R] using eval-parse-paste in a loop

2008-02-26 Thread Michael Anyadike-Danes
R-helpers I have 120 small Excel sheets to read and I am using library(xlsReadWrite): one example below. I had hoped to read sheets by looping over a list of numbers in their name (eg Book1.xls, Book2.xls, etc). I thought I had seen examples which used eval-parse-paste in this way.

Re: [R] R package to perform Horn's parallel analysis

2008-02-26 Thread falissard
And also scree.plot psy package. Bruno Falissard INSERM U669, PSIGIAM "Paris Sud Innovation Group in Adolescent Mental Health" Maison de Solenn 97 Boulevard de Port Royal 75679 Paris cedex 14, France tel : (+33) 6 81 82

Re: [R] using eval-parse-paste in a loop

2008-02-26 Thread Erik Iverson
> ### stripping off eval, looking for clues > > > > parse(paste('read.xls("Book',nam,'.xls",sheet=1,from=4,colClasses="numer > ic")',sep='')) > > Error in file(file, "r") : unable to open connection > > In addition: Warning message: > > In file(file, "r") : > > cannot open fi

Re: [R] using eval-parse-paste in a loop

2008-02-26 Thread Erik Iverson
Michael - > > 3. Equally, advice about a better approach would also be v. welcome. > As an alternative approach, you may want to save the sheet names in a list and then use the lapply function to read your data into a list. This would greatly reduce the 'clutter' of objects in your global

Re: [R] using eval-parse-paste in a loop

2008-02-26 Thread Bert Gunter
As Thomas Lumley has frequently noted, eval(parse...)) should generally be avoided. You probably want do.call(), as in ## warning: UNTESTED lapply(numbs, function(n)do.call(read.xls,list(file=paste("Book",n,".xls",sep=""),sheet=1, ...))) ## ... contains the other explicitly names arguments N

[R] Kalman Filter

2008-02-26 Thread Vladimír Šamaj
Hi My name is Vladimir Samaj. I am a student of Univerzity of Zilina. I am trying to implement Kalman Filter into my school work. I have some problems with understanding of R version of Kalman Filter in package stats( functions KalmanLike, KalmanRun, KalmanSmooth,KalmanForecast). 1) Can you tell

Re: [R] using eval-parse-paste in a loop

2008-02-26 Thread Tony Plate
Using eval-parse for this looks like overkill. You should just be able to do something straightforward like: for (i in 1:120) assign(paste("book", i, sep=""), read.xls(paste("Book", i, ".xls", sep=""), sheet=1, from=4, colClasses="numeric")) which would put your spreadsheets in variables bo

Re: [R] Custom LaTeX tables

2008-02-26 Thread Gabor Grothendieck
On Tue, Feb 26, 2008 at 10:58 AM, Werner Wernersen <[EMAIL PROTECTED]> wrote: > Hello, > > I am very happy that I have Sweave and R to write my > papers. But I still have to do some tables by hand > since I have not found out how I can customize the > latex tables produced by R further (I mainly us

[R] Reading a file created with Fortran

2008-02-26 Thread Dennis Fisher
Colleagues, I am trying to read a file written by Fortran. Several lines of the file are pasted below: 101 06e+050280.9777.484208.18147.20.246350.4020.7308717.882600 1 1 101 0.500280.9777.484208.18147.20.246350.4020.7308717.882600 0 0 101 100280.9777.484208.18147.20.246350.4020.730

Re: [R] Reading a file created with Fortran

2008-02-26 Thread Ben Bolker
Dennis Fisher plessthan.com> writes: > > Colleagues, > > I am trying to read a file written by Fortran. Several lines of the > file are pasted below: Perhaps read.fwf is what you want? (fwf stands for "fixed width format"). You would have to work out the field widths, but it would seem

Re: [R] Kenward-Roger correction in lme

2008-02-26 Thread Douglas Bates
On Mon, Feb 25, 2008 at 1:46 PM, Peter Dalgaard <[EMAIL PROTECTED]> wrote: > Ben Bolker wrote: > > stian mail.rockefeller.edu mail.rockefeller.edu> writes: > > > >> Hi,I am wondering how to conduct Kenward-Roger correction in > >> the linear mixed model using R. Any idea? > >> > >> Thanks a

[R] Subsetting within xyplot()

2008-02-26 Thread David Afshartous
All, I'm having problems w/ a simple attempt to subset an xyplot. The first plot below is a plot of y versus x for certain values of a third categorical variable z. Now I'd like to further restrict this to certain values of variable y. Neither of the two attempts below work. Any suggestions m

Re: [R] Subsetting within xyplot()

2008-02-26 Thread Henrique Dallazuanna
Try this: xyplot(y ~ x , data = junk.frm, type = c("g", "p","smooth"), pch=20, subset=z=="D" & y < 2) On 26/02/2008, David Afshartous <[EMAIL PROTECTED]> wrote: > > All, > > I'm having problems w/ a simple attempt to subset an xyplot. > > The first plot below is a plot of y versus x for certa

[R] combining 40,000 with 40,000 data frame (different tact)

2008-02-26 Thread stephen sefick
I have not been able to find anything to do what I want, so I am going to tact to the left. I have twp continuous time series for two years with the same fourteen variables. I would like to simply append the second year to the first. They both have the same column headings etc. Just like tappin

Re: [R] Subsetting within xyplot()

2008-02-26 Thread Erik Iverson
See the description of the subset argument in ?xyplot subset: logical or integer indexing vector (can be specified in terms of variables in 'data'). Only these rows of 'data' will be used for the plot. If 'subscripts' is 'TRUE', the subscripts will provide ind

[R] Summing up diagonals w/o for-loop

2008-02-26 Thread Camarda, Carlo Giovanni
Dear R-users, is there any way to sum up the elements of the "diagonals" of a matrix without using a for-loop? While there is a simple way over rows and columns, I don't see a straightforward multiplication for the diagonals, am I too demanding? Or, more likely, I'm lack some algebra trick? Is the

[R] Cryptic error message using RuleFit

2008-02-26 Thread Christopher Schwalm
Hello LIST, In using Rulefit I;ve bee nabel to fit a model using rulefit without incident. However, when trying to use intnull and interact things go astray. > rf=rulefit(x,"N", cat.vars="H", > not.used=c("G","T"),huber=0.9,path.speed=1); [snip] RuleFit model 2/26/2008 2:17p ave(abs(error))

Re: [R] Summing up diagonals w/o for-loop

2008-02-26 Thread Greg Snow
Does this do what you want? > d <- col(mat) - row(mat) > tapply( mat, d, sum ) Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECT

Re: [R] How to include the documentation of a function in a Sweave document?

2008-02-26 Thread Jean lobry
Dear all, thanks for your suggestions. I like the idea of including directly the LaTeX file corresponding to the targeted topic, however, my understanding from the reading of ?help is that these LaTeX files are not always available, depending on the build of R. I found a solution that works well

[R] Obtaining values from adfstat objects

2008-02-26 Thread Matt33
Hi, I'm using the ADF.test function in the uroot package to obtain an adfstat-class object. I'm wondering how I can extract the values (test statistic, p value, etc.) from this class, since it doesn't seem to have usual values. I get the following summary, but I'm not sure how to do anything with

Re: [R] Obtaining values from adfstat objects

2008-02-26 Thread Erik Iverson
Try str(yourobject) to see the structure of the object. If there were a value called, say, p.value, you could then do: myvar <- yourobject$p.value This is just general advice, I don't know the specifics of the package you mention, but try this first. Best, Erik Iverson Matt33 wrote: > Hi, >

Re: [R] Obtaining values from adfstat objects

2008-02-26 Thread Matt33
Thanks for the tip, Erik. I did check, but didn't see any $... elements to choose from. For comparison, I checked another object class (lm) with the str function, and it clearly showed $coefficients, $residuals, etc.. So it would seem that the usual approach doesn't work with adfstat objects... -

Re: [R] Summing up diagonals w/o for-loop

2008-02-26 Thread Marc Schwartz
Camarda, Carlo Giovanni wrote: > Dear R-users, > > is there any way to sum up the elements of the "diagonals" of a matrix > without using a for-loop? While there is a simple way over rows and > columns, I don't see a straightforward multiplication for the diagonals, > am I too demanding? Or, more l

[R] Multiple lines with a different color assigned to each line

2008-02-26 Thread Judith Flores
Dear R-experts, I want to assign different colors to groups of points, lines and segments in a plot. I have a vector(dat$tx) that is going to have a different number of levels every time the user wants to plot a set of data. The number of lines is going to be equal to the number of levels of

[R] Plot Principal component analysis

2008-02-26 Thread SNN
Hi, I have matrix of 300,000*115 (snps*individual). I ran the PCA on the covariance matrix which has a dimention oof 115*115. I have the first 100 individuals from group A and the rest of 15 individuals from group B. I need to plot the data in two and 3 dimentions with respect to PC1 and PC2 and

[R] numeric format

2008-02-26 Thread cvandy
Hi! I'm an R newbie and this should be a trivial problem, but I can't make it work and cannot find what I'm doing wrong in the literature. I entered the the command: table<-data.frame(x, scientific=F, digits=4) table This prints a column of x with 16 useless decimal places after the decimal point.

[R] lrm error message

2008-02-26 Thread Angelo Passalacqua
I'm trying to learn how to use the lrm() function by simulating data using an old dataset but it's giving me an error I don't understand: (nst$regular already exists) nst$regular<-as.ordered(nst$regular) nst$age<-rnorm(n=942,mean=43.20488,sd=17.03) nst$age<-round(age,digits=0) regform<-regular~

Re: [R] combining 40,000 with 40,000 data frame (different tact)

2008-02-26 Thread Paul Hiemstra
stephen sefick schreef: > I have not been able to find anything to do what I want, so I am going > to tact to the left. I have twp continuous time series for two years > with the same fourteen variables. I would like to simply append the > second year to the first. They both have the same column

Re: [R] combining 40,000 with 40,000 data frame (different tact)

2008-02-26 Thread jim holtman
?rbind On 2/26/08, stephen sefick <[EMAIL PROTECTED]> wrote: > I have not been able to find anything to do what I want, so I am going > to tact to the left. I have twp continuous time series for two years > with the same fourteen variables. I would like to simply append the > second year to the

Re: [R] Set without argument

2008-02-26 Thread Christophe Genolini
Hi Martin What do you think of the following code ? A <- 1 imputeMyObj <- function(x){ xImp <- 3 #Calcul for Imputation of x nam<-deparse(substitute(x)) assign(nam,xImp,envir=parent.frame()) } imputeMyObj(A) A I guess it is not usual, but do you think it is 'bad' programming or will have

Re: [R] numeric format

2008-02-26 Thread Erik Iverson
Without knowing what your 'x' is, it's hard to see what is happening that you don't like. Your data.frame function creates a data.frame containing columns scientific and digits, equal to FALSE and 4 for all rows, respectively. Is that what you want? cvandy wrote: > Hi! > I'm an R newbie and

Re: [R] Plot Principal component analysis

2008-02-26 Thread Christos Hatzis
If your samples are in the specified order (i.e. first 100 from group A and remaining from group B) you can try the following in your plot call: plot(..., col=c("red", "blue")[c(rep(100, 1), rep(15, 2))]) -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECT

Re: [R] numeric format

2008-02-26 Thread jim holtman
Those are parameter to 'print'; what you want is something like: > x <- data.frame(a=runif(10)) > print(x) a 1 0.713705394 2 0.715496609 3 0.629578524 4 0.184360667 5 0.456639418 6 0.008667156 7 0.260985437 8 0.270915631 9 0.689128652 10 0.302484280 > print(x,scientific=F, d

Re: [R] Multiple lines with a different color assigned to each line

2008-02-26 Thread John Kane
I am not sure if I completely understand but would something like this work? (not tested) points( col=i) lines ( col=i=1) --- Judith Flores <[EMAIL PROTECTED]> wrote: > Dear R-experts, > >I want to assign different colors to groups of > points, lines and segments in a plot. > > I

Re: [R] Plot Principal component analysis

2008-02-26 Thread Christos Hatzis
Sorry, it should have been: col = c("red", "blue")[c(rep(1, 100), rep(2, 15))] -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Christos Hatzis > Sent: Tuesday, February 26, 2008 4:46 PM > To: 'SNN'; r-help@r-project.org > Subject: Re: [

Re: [R] numeric format

2008-02-26 Thread John Kane
Can you give a working example of what is happening and explain what is x? With a simple x vector of x <- rnorm(20, 5, 2) I don't get anything like what you seem to be getting. My code === x <- rnorm(20, 5, 2) table<-data.frame(x, scientific=F, digi

[R] "Raw" histogram plots

2008-02-26 Thread Andre Nathan
Hello I need to plot a histogram, but insted of using bars, I'd like to plot the data points. I've been doing it like this so far: h <- hist(x, plot = F) plot(y = x$counts / sum(x$counts), x = x$breaks[2:length(x$breaks)], type = "p", log = "xy") Sometimes I want to have a look

Re: [R] "Raw" histogram plots

2008-02-26 Thread roger koenker
take a look at ?stem There is still a place for handtools in the age of integrated circuits. Of course, avoiding binning isn't really desirable. url:www.econ.uiuc.edu/~rogerRoger Koenker email[EMAIL PROTECTED]Department of Economics vox: 217-333-4558

Re: [R] numeric format

2008-02-26 Thread Rolf Turner
On 27/02/2008, at 11:01 AM, John Kane wrote: > Can you give a working example of what is happening > and explain what is x? > > With a simple x vector of x <- rnorm(20, 5, 2) > I don't get anything like what you seem to be getting. > > My code > ===

[R] Multiple lines with a different color assigned to each line (corrected code)

2008-02-26 Thread Judith Flores
Sorry, I just realized I didn't type in the correct names of the variables I am working with, this is how it should be: plot(1,1,type="n") for (i in summ$tx) { points(summ$timep[summ$tx==i],summ$mn[summ$tx==i]) lines(summ$timep[summ$tx==i],summ$mn[summ$tx==i]) } Thank you, Judith

Re: [R] Rcmdr importing excel files

2008-02-26 Thread John Kane
I'm on Windows XP R 2.6.2 The command Data > Import > From Excel, Access etc Supply data.frame name Select xls file and then select the sheet seem to work for me What is not showing? --- stephen sefick <[EMAIL PROTECTED]> wrote: > I am using R 2.6.2 on Mac OS X 10.4.9- I would like > to impo

[R] RSPerl on OS X Server 10.4.11

2008-02-26 Thread Gregory Downs
Hello, I tried the R-Sig-Mac list with this query, but had no takers. I hope that the following isn't too far off the mark for this list. Many thanks in advance if someone can help me out! Quick summary: I can't get RSPerl working on a PPC G5 with the pre-compiled binary for Mac OS X, but

Re: [R] Rcmdr importing excel files

2008-02-26 Thread John Fox
Dear John and Stephen, As I recall, importing from Excel, Access, or dBase files works properly only under Windows, and consequently the menu item appears only in Windows systems. I frankly don't recall why this is the case, since the RODBC package is used. The code for reading these kinds of file

Re: [R] Rcmdr importing excel files

2008-02-26 Thread John Kane
Thanks very much. --- John Fox <[EMAIL PROTECTED]> wrote: > Dear John and Stephen, > > As I recall, importing from Excel, Access, or dBase > files works properly > only under Windows, and consequently the menu item > appears only in Windows > systems. I frankly don't recall why this is the > cas

[R] lasso with Cox regression

2008-02-26 Thread array chip
Rob Tibshirani propose to use lasso with Cox regression for variable selection in his 1997 paper "The lasso method for variable selection in the Cox model" published in Statistics In Medicine 16:385. I understand the lars() function in lars package implemented lasso, but it does not do lasso with C

Re: [R] "Raw" histogram plots

2008-02-26 Thread hadley wickham
On Tue, Feb 26, 2008 at 4:10 PM, Andre Nathan <[EMAIL PROTECTED]> wrote: > Hello > > I need to plot a histogram, but insted of using bars, I'd like to plot > the data points. I've been doing it like this so far: > > h <- hist(x, plot = F) > plot(y = x$counts / sum(x$counts), >x = x$br

Re: [R] Multiple lines with a different color assigned to each line (corrected code)

2008-02-26 Thread hadley wickham
It's hard to provide a useful answer without know what your data looks like, but maybe something like: library(ggplot2) qplot(timep, mn, data=summ, geom="line", colour = tx) Hadley On Tue, Feb 26, 2008 at 4:24 PM, Judith Flores <[EMAIL PROTECTED]> wrote: > Sorry, I just realized I didn't type in

Re: [R] Rcmdr importing excel files

2008-02-26 Thread Prof Brian Ripley
On Tue, 26 Feb 2008, John Fox wrote: > Dear John and Stephen, > > As I recall, importing from Excel, Access, or dBase files works properly > only under Windows, and consequently the menu item appears only in Windows > systems. I frankly don't recall why this is the case, since the RODBC > package

Re: [R] GLM

2008-02-26 Thread Bill.Venables
Just a couple of notes. * What you are attempting to fit here is a linear model, or, more precisely 13112 simple linear regressions. Why not just use 'lm'? 'glm' is for fitting generalized linear models and using it for this special case is going to be computationally costly. [NB the concept

Re: [R] numeric format

2008-02-26 Thread cvandy
Thanks, Erik, This is a partial copy of my code. I want to get rid of the left column of integers and I want to control the number of decimal places after the decimal point. > j<-0.4 > for(i in 1:20){ + j=j+0.1;cp[i]<-pnorm(-j*3)*10^6;ratio[i]<-j} > table<-data.frame(ratio,cp) > table rati

[R] multdrc error---Error in mdrcOpt(opfct, startVec, optMethod, derFlag, constrained, warnVal

2008-02-26 Thread Xin Gong
Hi, I am newbie of R. I a currently using multdrc object to generate fitting curve and IC50. My 384 well format raw data contains multi dose response curves. My script goes through set of data then produce curve and ic50. Here is my sudo code: For (plateid in platelist) { Input data (

[R] Multiple linear regression with for loop

2008-02-26 Thread M�hlbacher
Hi everyone! I have an array containing the following fields for over hundred compounds: cpd, activity, fixterm, energy1, energy2, energy3, ... I want to run a multiple linear regression on all entries of an array. Therefore I tried to do this with a for loop. (Maybe there is a direct way of c

[R] NLS -- multiplicative errors and group comparison

2008-02-26 Thread Derek Ogle
Hello, I am attempting to fit a non-linear model (Von Bertalanffy growth model) to fish length-at-age data with the purpose of determining if any of the three parameters differ between male and female fish. I believe that I can successfully accomplish this goal assuming an additive error struc

[R] score test statistic in logistic regression

2008-02-26 Thread bkelcey
Hi, looking for a function or syntax to estimate the score test in logistic regression for the null hypothesis b1=0 in the model logit(p)=b0+ b1*x +b2*z. Data comes from the binomial distribution (n,p). Thanks, ben __ R-help@r-project.org mailing lis

[R] Add a rectangle behind a plot

2008-02-26 Thread Judith Flores
Hi there, I found one reference to add a reactangle behind a plot using plot(...,add=T), I tried this but didn't obtain the desired result. If a I have the following code: plot(x,y) rect(xleft, ybottom, xright,ytop,col='green) The rectangle appear on top of the plot. Any help will be gre

Re: [R] Highlighting different series with colors

2008-02-26 Thread Michael A. Miller
> "Valentin" == Valentin Bellassen <[EMAIL PROTECTED]> writes: > Hello, I have a data frame with 3 vectors $x, $y, and > $type. I would like to plot $x~$y and having different > colors for the corresponding points, one for each level of > $type. Would someone know how to do tha

Re: [R] "Raw" histogram plots

2008-02-26 Thread Andre Nathan
I know about stem, but the data set has 1 million points, so it's not very useful here. I want to avoid binning just to have an idea about the shape of the distribution, before deciding how I'll bin it. Andre On Tue, 2008-02-26 at 16:20 -0600, roger koenker wrote: > take a look at > > ?ste

[R] missing packages from install

2008-02-26 Thread array chip
Hi, When I install new packages from CRAN, I frequently find that some packages were missing from the download queue. For example, on one of my computer with R2.6.2, I can not find package glmpath from the download queue. On my other computer with R2.5.1, I could still find that particular package

[R] Hmisc xYplot won't do conditioning on factors?

2008-02-26 Thread Ivan Adzhubey
Hi, I am trying to replace (lattice) standard xyplot with xYplot variant from Hmisc package to be able to add error bars to my plots. However, this does not work, e.g: library(lattice) d <- data.frame( SKU=gl(3, 1, 21, labels=c("a", "b", "c")), Weekday=gl(7, 3, 21), QC

Re: [R] "Raw" histogram plots

2008-02-26 Thread Peter Alspach
Andre If I understand you correctly, you could try a barplot() on the result of table(). HTH .. Peter Alspach > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Andre Nathan > Sent: Wednesday, 27 February 2008 1:34 p.m. > To: roger koenker > C

[R] Adding LaTeX cross-references into Sweave plots

2008-02-26 Thread Peter Dunn
Hi all I'm using Sweave and LaTeX, and love how they interact. But here's a different interaction I'm not sure how to achieve; I hope someone can help. I use a simple example, of course, to demonstrate. Suppose in my LaTeX document I have this: Here is a linear equation: \beg

  1   2   >