[R] stepAICc

2009-04-30 Thread Dr. Christoph Scherber
Dear R users, Would it be difficult to change the code of stepAIC (from the MASS library) to use AICc instead of AIC? It would be great to know of someone has tried this already. Best wishes Christoph. __ R-help@r-project.org mailing list https://stat

[R] Rotated text on a regression line

2008-05-27 Thread Dr. Christoph Scherber
Dear all, I stumbled over a problem recently when trying to use srt with text() on a windows device. What I intended to do was to plot a simple regression line, and to rotate a piece of text such that the text has the same angle as the regression line. However, the text is always plotted in a sl

Re: [R] Rotated text on a regression line

2008-05-27 Thread Dr. Christoph Scherber
Thanks to all for the postings so far! I found that setting asp=0.5 and then dividing the slope by 2 seems to do the trick: ## x=1:10 y=x*2-rnorm(1:10) plot(x,y,pch=16,asp=0.5) abline(lm(y~x)) yval=predict(lm(y~x),list(x=rep(2,length(x[1] slope=as.numeric(lm(y~x)[[1]][2]) text(2,yval,"Regre

Re: [R] problem pasting into Illustrator CS2

2008-06-04 Thread Dr. Christoph Scherber
Dear Courtney, Are you exporting the graphs as postscript files? This is the usual way I do it when moving graphs between R and Illustrator CS2. I´m afraid I do not have a Mac, but I suppose CS2 runs similarly on both systems. Best wishes Christoph > To Whom it May Concern: > I have been using

[R] Multivariate LM: calculating F-values after calling linear.hypothesis

2008-06-07 Thread Dr. Christoph Scherber
es Christoph -- Dr. Christoph Scherber University of Goettingen DNPW, Agroecology Waldweg 26 D-37073 Goettingen, Germany www.gwdg.de/~cscherb1 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the pos

Re: [R] Problems with lm()

2008-06-21 Thread Dr. Christoph Scherber
Dear Hsin-Ya, Then it might be that you have checked "Type 3 sums of squares" in SPSS, while R uses type 1 by default. > > Dear Dr. Andrew Robinson: > > Thanks for your reply. In my data, subject is nested within sequence. > According to Dr. Christoph's reply, I have change the sequence data. >

Re: [R] The Green Book and its relevance to R

2008-06-21 Thread Dr. Christoph Scherber
Dear Ben, Do you mean "Statistical Computing" by Crawley? In that case, there is a web appendix showing some differences between R and S-Plus. There is also John Fox´s Book "Companion to Applied Linear Regression" that compares R and S-Plus, and Richard Heiberger´s book (Heiberger & Holland) comp

[R] Problem with error handling inside a function

2008-10-25 Thread Dr. Christoph Scherber
Dear R users, I have written a function that runs several statistical models and extracts the AIC values from them. As a (nonsense) example, I use the iris dataset: # data(iris) attach(iris) evaluate.all=function(response,...){ response=get(response) #retrieves the response variab