Re: [R] lm design matrix bug?

2007-10-29 Thread Tim Calkins
check the dimensions of your X and P matrices: dim(X) [1] 21 9 dim(P) [1] 9 21 what you see is that the final row is *named* 26. It's actually row 21. cheers, On 10/29/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi All Maybe I dont understand it, but I would have expected that the

Re: [R] Fwd: cut.dendrogram and cutree

2007-10-29 Thread Agustin Lobo
Thanks, But this is not solving my problem, let me further explain by following the example in the help page for dendrogram: require(graphics); require(utils) hc - hclust(dist(USArrests), ave) dend1 - as.dendrogram(hc) dend2 - cut(dend1, h=70) plot(dend2$upper,center=T) What I want to know are

Re: [R] cut.dendrogram and cutree

2007-10-29 Thread Yaomin Xu
Agus, How about the following? labels(dend2$lower[[1]]) [1] FloridaNorth Carolina labels(dend2$lower[[2]]) [1] California Maryland ArizonaNew Mexico Delaware AlabamaLouisiana [8] Illinois New York Michigan Nevada Alaska

[R] meaning of lenwrk value in adapt function

2007-10-29 Thread Eric Archer
R-listers, In using the adapt function, I am getting the following warning: Ifail=2, lenwrk was too small. -- fix adapt() ! Check the returned relerr! in: adapt(ndim = 2, lower = lower.limit, upper = upper.limit, functn = pr.set, Would someone explain what the 'lenwrk' value indicates in

Re: [R] Installing ade4, missing libraries

2007-10-29 Thread Prof Brian Ripley
Please do not hijack a different thread for your question. In particular do not send your question directly to those who asked or helped with other questions. You need libgfortran to build R. I assume you did a binary install on 'Linux', but without the details the R posting guide asked you

[R] Installing ade4, missing libraries

2007-10-29 Thread Ndoye Souleymane
Dear R users, I have tried to install ade4 package under Linux using R CDM INSTALL . But a the process stoped with an error as shown bellowed “cannot find -lgfortran”. Is it a required package for Linux. If so, Is this package available in RPM ? Many thanks, Best regards, Souleymane

Re: [R] cut.dendrogram and cutree

2007-10-29 Thread Agustin Lobo
Yes, I was just trying unlist() in a similar way. All I need is to apply labels() and/or unlist() to each element of the list dend2$lower: lista - vector(list, length(dend2$lower)) for (i in 1:length(dend2$lower)) { lista[[i]] - labels(dend2$lower[[i]]) } lista Thanks! Agus

Re: [R] meaning of lenwrk value in adapt function

2007-10-29 Thread Frede Aakmann Tøgersen
Well the adapt() function in R is based on A. Genz's fortran routine of the same name. In the routine some memory allocation is done statically, but since we're dealing with a adaptive integration routine, meaning that based on how wiggly or wild your integrand is in the integration area the

[R] using survfit

2007-10-29 Thread raymond chiruka
hie when i use plot.survfit to plot more than one graph why I only see the last graph how do i see the other graphs.for example n=20 n1=n/2 n2=n/4 a11=4;a12=4 ;a21=4 ;a22=4 t1-array(1,c(n1)) t2-array(2,c(n1))

[R] Changing size of lattice plot?

2007-10-29 Thread Rory Winston
Hi I am having a bit of difficulty with changing the canvas size on a trellis/lattice plot. I am plotting two cubes of 3-dimensional random numbers, as follows: library(gsl) library(lattice) q - qrng_alloc(type=sobol, 3) npoints - 200 rs - qrng_get(q,npoints) # Plot the normal variates in a

Re: [R] Newey-West and SUR regression models

2007-10-29 Thread Achim Zeileis
On Fri, 26 Oct 2007, Richard Saba wrote: Is anyone aware of a procedure to apply Newey-West corrections for autocorrelation to a SUR regression model? The SANDWICH package seems to be applicable only to LM or GLM models. No, sandwich is applicable to any estimating function-based model,

[R] Cluster Analysis

2007-10-29 Thread Katia Freire
Dear all, I would like to know if I can do a hierarchical cluster analysis in R using my own similarity matrix and how. Thanks. Katia Freire. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Changing size of lattice plot?

2007-10-29 Thread Prof Brian Ripley
The 'base height and width of a lattice plot' are the dimensions of the graphics device in use. You set those when you open the graphics device (which you are using was unstated, as was your OS), and each device has device-specific defaults. I'd suggest something like windows(width=8,

Re: [R] Changing size of lattice plot?

2007-10-29 Thread Prof Brian Ripley
On Mon, 29 Oct 2007, Rory Winston wrote: Thank you Brian! This seems to do what I want for a screen device, however, The 'this' having been deleted from your reply ...! I am using this plot within Sweave, so the code in my orginal email is within a = block. If I place a call to windows()

Re: [R] Changing size of lattice plot?

2007-10-29 Thread Rory Winston
Thank you Brian! This seems to do what I want for a screen device, however, I am using this plot within Sweave, so the code in my orginal email is within a = block. If I place a call to windows() just before I print() the lattice plot, then I get an access denied error when generating the TeX

Re: [R] is there a similar function to perform repeated statements asin SAS PROC MIXED?

2007-10-29 Thread Dimitris Rizopoulos
Dear Prof. Bates, first let me say that I completely agree with your points and your frustration at the SAS PROC MIXED sloppy terminology. To be honest I've only used SAS PROC MIXED twice, and I really do prefer the flexibility lme() and lmer(). Now regarding the term unstructured

[R] Can I create pdfs with dataframes instead of images?

2007-10-29 Thread Tom.O
Hi I am doing some correlation analysis where I graphically display the results by using image() and then exporting the results in a PDF. I also use the par(mfrow=c(2,2)) to fit 4 images on the same sheet. But I wonder if it possible to use the some methodology to export the 4 matrixes on a PDF

[R] x11 window queston

2007-10-29 Thread Luke Spadavecchia
Hi all, Sorry for reposting, but I think my last request was a little confusing. I am trying to keep my x windows open after I exit the R session, so when I have produced a series of plots from R I would like to retain the graphics as x windows after exiting with q(). This would be

Re: [R] How to make own function load automatically on startup

2007-10-29 Thread Hans-Peter
My code contains following snippet: xlsReadWrite::read.xls, this is because another package I load masks read.xls function and :: help me to select correct read.xls. I guessed this use of :: but I would really like to know what :: is and where can I read more about this function? help(::)

Re: [R] Cluster Analysis

2007-10-29 Thread Dieter Vanderelst
take a look at hclust() Dieter Katia Freire wrote: Dear all, I would like to know if I can do a hierarchical cluster analysis in R using my own similarity matrix and how. Thanks. Katia Freire. [[alternative HTML version deleted]]

Re: [R] Installing ade4, missing libraries

2007-10-29 Thread Ndoye Souleymane
Using the command R CMD INSTALL I finally succed the isnstallation of ade4 juste by using ade4_1.4-3.tar.gz instead of ade4_1.4-5.tar.gz. Many thanks again, Faithfully Yours, Souleymane N'Doye Date: Mon, 29 Oct 2007 08:22:21 + From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: [EMAIL

Re: [R] Can I create pdfs with dataframes instead of images?

2007-10-29 Thread Thibaut Jombart
Tom.O wrote: Hi I am doing some correlation analysis where I graphically display the results by using image() and then exporting the results in a PDF. I also use the par(mfrow=c(2,2)) to fit 4 images on the same sheet. But I wonder if it possible to use the some methodology to export the 4

Re: [R] Cluster Analysis

2007-10-29 Thread elw
Subject: [R] Cluster Analysis Dear all, I would like to know if I can do a hierarchical cluster analysis in R using my own similarity matrix and how. Thanks. Katia Freire. Yes. ;) Reading the help for dist() and hclust() should make the procedure for doing this appear fairly

Re: [R] help please

2007-10-29 Thread Ben Bolker
osita k ezeh wrote: hello, please can anyone help me out. Am a new user of R program. Am having problem with this code below, not getting the expected results. Did you not get my and Uwe's previous responses to your question? Ben Bolker -- View this message in context:

[R] Cannot install 'rgl'

2007-10-29 Thread Metaxab
Hello I have the following problem: I am trying to install the 'rgl' package by: sudo R install.packages('rgl',dependencies=TRUE) I get the following message checking for X... no configure: error: X11 not found but required, configure aborted. ERROR: configuration failed for package 'rgl' **

Re: [R] Markov models

2007-10-29 Thread Doran, Harold
David I think transition probabilities can be estimated in numerous ways using general statistical models. For example, i've estimated them using the prop.table() function as well as through the use of logistic regression via glm(). Harold -Original Message- From: [EMAIL PROTECTED]

Re: [R] Cannot install 'rgl'

2007-10-29 Thread elw
Do you have the X11 devel packages installed? You probably do not. --elijah On Mon, 29 Oct 2007, Metaxab wrote: Date: Mon, 29 Oct 2007 05:45:33 -0700 (PDT) From: Metaxab [EMAIL PROTECTED] To: r-help@r-project.org Subject: [R] Cannot install 'rgl' Hello I have the following

Re: [R] PDF output

2007-10-29 Thread Prof Brian Ripley
Oh PLEASE do look in the list archives: this has come up several times. It does not happen in R-patched, and a simple workaround for 2.6.0 has already been posted here. On Mon, 29 Oct 2007, Pedro de Barros wrote: Dear All, I am trying to save a plot made with ggplot as pdf. I just created

Re: [R] PDF output

2007-10-29 Thread Thibaut Jombart
Pedro de Barros wrote: Dear All, I am trying to save a plot made with ggplot as pdf. I just created the plot, then printed it to the default graphics device (screen). I then tried to create a pdf file choosing (from the menus) File-Save As-PDF file. However, I get an error as Error: Invalid

Re: [R] PDF output

2007-10-29 Thread Uwe Ligges
This has been reported several times already and has been fixed in R-2.6.0 patched. Uwe Ligges Pedro de Barros wrote: Dear All, I am trying to save a plot made with ggplot as pdf. I just created the plot, then printed it to the default graphics device (screen). I then tried to create

Re: [R] PDF output

2007-10-29 Thread Pedro de Barros
Thanks!!! Sorry for not having checked that - just did not remember... Thanks again, Pedro At 12:59 2007/10/29, you wrote: This has been reported several times already and has been fixed in R-2.6.0 patched. Uwe Ligges Pedro de Barros wrote: Dear All, I am trying to save a plot made with

Re: [R] Cannot install 'rgl'

2007-10-29 Thread Dirk Eddelbuettel
On 29 October 2007 at 05:45, Metaxab wrote: | | Hello I have the following problem: | | I am trying to install the 'rgl' package by: | | sudo R | install.packages('rgl',dependencies=TRUE) | | | I get the following message | | checking for X... no | configure: error: X11 not found but

[R] quantiles for timestep out of large list

2007-10-29 Thread marcg
dear R I have a list consisting of 20 matrices of dimensions (1600, 15). Out of this list I plot median, max, min values in a timeplot, that works well with the code at the end. I would like to plot quartile ranges.'m not able to find a way to compute the quantile for every time step. Thanks

Re: [R] using survfit

2007-10-29 Thread Ritwik Sinha
Hi, You can use the par function to set the parameters of the plot to have multiple plots in one output. Have something like par(mfrow=c(2,1)) before your plot commands. You could also write the the outputs to a ps, pdf or jpeg file (look for the pdf, postscript and jpeg commands). That way the

Re: [R] flops calculation

2007-10-29 Thread Thomas Lumley
On Sun, 28 Oct 2007, kevinchang wrote: Hi all, Since proc.time return three different kind of times (user, system and elapsed) , I am wondering which one is right for calculating flops. Probably none of them. The 'user'+'system' time is the amount of CPU time that can be blamed on R. For

Re: [R] Help for Beginner!!

2007-10-29 Thread Mike Prager
Leandre Bassole [EMAIL PROTECTED] wrote: I am a new user of R. I am very familar to Stata, but few days ago I have decided to switch to R. But R langage is very difficult.I really want to know the best way to learn this famous and interesting software. I agree with the suggestions

[R] biserial correlation with pkg polycor

2007-10-29 Thread Tom Willems
Dear R-ussers, While looking for a way to calculate the association between a countinuous and a binary variable, i found a procedure called point biserial corralation. Me, not being a mathematicion, i did my very best to understand what it was all about, and then i found a easily

Re: [R] [non-statistics question]methodological problem

2007-10-29 Thread Thomas Lumley
On Sat, 27 Oct 2007, eugen pircalabelu wrote: As mentioned in the subject, my question regards more the methodological part that accompanies survey design and the statistical part that is involved. So, I have the following data: You might get more helpful (or more authoritative) advice on

[R] shading of curves with polygon

2007-10-29 Thread mdgi
Hello again With the poylgon function it's possible to plot shaded areas under a curve. But somehow it connects the start and the endpoint of a line and fills whats between them. I would actually like to set the boarders of the shading by two min and max curves, but I failed. i tried stl like:

Re: [R] Effect sizes

2007-10-29 Thread Thomas Lumley
t.test() does give effect sizes: that is, it gives the actual difference in means, and a confidence interval for this difference. If you want to standardize your effect sizes you will have to do this yourself. This is because the customs for standardization are different in different fields.

[R] Loop

2007-10-29 Thread livia
Hello, I would like to build a list through the following codes.know1 know2 are some list obtained before. know1 has the length of 50 (as for i), know2 has the lengh of 50 (as for i), know1[[i]] has the length of 1000, know2[[i]] has the length of 1132. I would like to get the list finalreturnc,

Re: [R] plot for binomial glm

2007-10-29 Thread Tom Willems
Dear Jonh, there is probably an easier way, but i find this to give nice smooth plots. good luck with it. ### R-file alive - data$num - data$numdead numdead - data$numdead temp - data$temp data.table - cbind(numdead, alive) points.graph - data$alive/data$num glm.mort-glm(data.table ~ temp,

[R] how to split data.frame by row?

2007-10-29 Thread Weiwei Shi
hi, if I have 20 x 3 data.frame, how to split it into 10 x 6 (moving the lower part of 10x3 to column) or 5 x 12 thanks -- Weiwei Shi, Ph.D Research Scientist GeneGO, Inc. Did you always know? No, I did not. But I believed... ---Matrix III __

Re: [R] biserial correlation with pkg polycor

2007-10-29 Thread John Fox
Dear Tom, I'm afraid that you're confusing the point-biserial correlation with the biserial correlation. It's the latter that polyserial() in the polycor package computes; the biserial correlation is a special case when the (ordered) categorical variable has just two categories. Generally,

[R] Qsub - unable to open connection to X11 display

2007-10-29 Thread Bernd Jagla
Hi there, I want to run an R script on a cluster with qsub. Obviously I don't want to display any X window, but I want use png() or something else to write out images. Unfortunately I get the following error message: png(filename = ALL.png, width = 480, height = 480, pointsize = 12, bg

Re: [R] shading of curves with polygon

2007-10-29 Thread ONKELINX, Thierry
If min and max are two vectors with values on the y-axis and x is a vector of the values on the x-axis, then you need. x - 1:50 z - matrix(rnorm(100), ncol = 2) mini - apply(z, 1, min) maxi - apply(z, 1, max) plot(x, maxi, ylim = range(c(mini, maxi)), type = l) lines(x, mini) polygon(c(x,

Re: [R] Elasticity in Leslie Matrix

2007-10-29 Thread Chris Stubben
Sorry, I didn't think carefully about your question on my first reply, so please ignore it. Chapter 9 in Morris and Doak (2002) cover vital rate elasticities and sensitivities (see Box 9.1 for Matlab code http://www.sinauer.com/PVA/vitalsens.m). Simon, thanks for posting your code, I will

Re: [R] how to split data.frame by row?

2007-10-29 Thread Henrique Dallazuanna
If I understand your question: df - data.frame(x=rnorm(20), y=rnorm(20), z=rnorm(20)) df - as.matrix(df) dim(df) dim(df) - c(10,6) dim(df) - c(5,12) On 29/10/2007, Weiwei Shi [EMAIL PROTECTED] wrote: hi, if I have 20 x 3 data.frame, how to split it into 10 x 6 (moving the lower part of 10x3

Re: [R] plot for binomial glm

2007-10-29 Thread ONKELINX, Thierry
Tom, Allow me to give a few comments. x - c(x=(rep(33:55,1))) #Is a very uggly way to write x - 33:55 #This (untested) code will probably generate a smooth plot too. Maybe it's not the plot that you intended to create. I'm just guessing as I can not reproduce your code (because I don't have

[R] Strange results with anova.glm()

2007-10-29 Thread Gustaf Granath
Hi, I have been struggling with this problem for some time now. Internet, books haven't been able to help me. ## I have factorial design with counts (fruits) as response variable. str(stubb) 'data.frame': 334 obs. of 5 variables: $ id : int 6 23 24 25 26 27 28 29 31 34 ... $ infl.treat :

Re: [R] how to split data.frame by row?

2007-10-29 Thread Weiwei Shi
Thanks. but I need to make it into a more general case instead of that example On 10/29/07, Henrique Dallazuanna [EMAIL PROTECTED] wrote: If I understand your question: df - data.frame(x=rnorm(20), y=rnorm(20), z=rnorm(20)) df - as.matrix(df) dim(df) dim(df) - c(10,6) dim(df) - c(5,12)

Re: [R] Qsub - unable to open connection to X11 display

2007-10-29 Thread Duncan Murdoch
On 10/29/2007 12:06 PM, Bernd Jagla wrote: Hi there, I want to run an R script on a cluster with qsub. Obviously I don't want to display any X window, but I want use png() or something else to write out images. Unfortunately I get the following error message: png(filename =

Re: [R] how to split data.frame by row?

2007-10-29 Thread Peter Dalgaard
Weiwei Shi wrote: Thanks. but I need to make it into a more general case instead of that example How about this? reshape(data.frame(df,expand.grid(id=1:10,time=1:2)), direction=wide) id x.1 y.1z.1 x.2y.2z.2 1 1 -1.33527134 -0.31893666

[R] Wilkcoxon with bootstrap

2007-10-29 Thread Stratford, Jeffrey
R-users, Background: I took roadside samples of avian species richness and I would like to model the relationship between species richness and habitat around my 500 + sample locations (in a file called ROADSIDE). However, one criticism is that roadside habitats do not represent habitats

Re: [R] Qsub - unable to open connection to X11 display

2007-10-29 Thread Martin Morgan
Hi Bernd, A little speculation / uninformed input on my part, but I'm guessing that the R on your nodes is compiled without X11 support, probably because the cluster nodes have X11, but not the X11 header files required by R when it is built. Probably capabilities()[[X11]] [1] FALSE One

Re: [R] how to split data.frame by row?

2007-10-29 Thread Henrique Dallazuanna
Perhaps: SplitByRow - function(data, rows){ coln - colnames(data) df - as.matrix(data) dim(df) - c(dim(df)[1]/rows, dim(df)[2]*rows) colnames(df) - rep(coln, rows) return(df) } SplitByRow(df, 2) On 29/10/2007, Weiwei Shi [EMAIL PROTECTED] wrote: Thanks. but I need to make it into a

Re: [R] Qsub - unable to open connection to X11 display

2007-10-29 Thread Bernd Jagla
Thanks for the comments/suggestions. R is running smoothly on the head node with a small sample script. We are using the grid engine qsub system. There is no -X option available for that one. Can't I just disable the X11? There is such an option in Matlab, so I thought R would have something

Re: [R] lm design matrix bug?

2007-10-29 Thread toby909
uups, ok, I see, thanks Tim Calkins wrote: check the dimensions of your X and P matrices: dim(X) [1] 21 9 dim(P) [1] 9 21 what you see is that the final row is *named* 26. It's actually row 21. cheers, On 10/29/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi All Maybe I dont

Re: [R] Qsub - unable to open connection to X11 display

2007-10-29 Thread Benilton Carvalho
But doesn't it suffice to replace png() by bitmap()? b On Oct 29, 2007, at 12:47 PM, Duncan Murdoch wrote: On 10/29/2007 12:06 PM, Bernd Jagla wrote: Hi there, I want to run an R script on a cluster with qsub. Obviously I don't want to display any X window, but I want use png() or

[R] time difference error

2007-10-29 Thread Jojje Andersson
Hello! I have a problem making a new variabel in a dataframe that consists of a time difference. It seems that the new variable gets into the dataframe but I cant look at it anymoore. Here is what hapens. tdiff- difftime(Kontrolltid, Starttid, units=auto) tdiffTime differences in

[R] covariance matrix of the regression coefficients

2007-10-29 Thread Peter B. Mandeville
Greetings, Cohen, Cohen, West, and Aiken 2003 (Applied Multiple Regression-Correlation Analysis for the Behavioral Sciences, Third Edition) on page 273 state the covariance matrix of the regression coefficients is provided by standard programs for multiple regression, including SAS, SPSS, and

[R] Non-independent paired measures

2007-10-29 Thread Nair, Murlidharan T
I am interested in generating simulated data for demonstrating sampling distribution of the mean difference between non-independent paired measures. Is there an elegant way do generate non-independent data sets? Thanks ../Murli [[alternative HTML version deleted]]

[R] covariance matrix of the regression coefficients

2007-10-29 Thread Peter B. Mandeville
Greetings, Cohen, Cohen, West, and Aiken 2003 (Applied Multiple Regression-Correlation Analysis for the Behavioral Sciences, Third Edition) on page 273 state the covariance matrix of the regression coefficients is provided by standard programs for multiple regression, including SAS, SPSS, and

[R] covariance matrix of the regression coefficients

2007-10-29 Thread Peter B. Mandeville
Greetings, On page 273, Cohen, Cohen, West, and Aiken (Applied Multiple Regression/Correlation Analysis for the Behavioral Sciences, Third Edition, state that the covariance matrix of the regression coefficients is provided by standard programs for multiple regression, including SAS, SPSS,

Re: [R] covariance matrix of the regression coefficients

2007-10-29 Thread Ravi Varadhan
?vcov You can use vcov(lm.obj) to extract the covariance matrix, where lm.obj is your fitted object from lm(). Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of

Re: [R] how to split data.frame by row?

2007-10-29 Thread Thibaut Jombart
Henrique Dallazuanna wrote: If I understand your question: df - data.frame(x=rnorm(20), y=rnorm(20), z=rnorm(20)) df - as.matrix(df) dim(df) dim(df) - c(10,6) dim(df) - c(5,12) On 29/10/2007, Weiwei Shi [EMAIL PROTECTED] wrote: hi, if I have 20 x 3 data.frame, how to split it into 10 x 6

Re: [R] flops calculation

2007-10-29 Thread jim holtman
But typically what you are looking for is the number of operations per unit time. In the case of R, what you would probably be doing is to monitor the time that it takes to go through a number of scenarios and then divide this number by the CPU time and you will get number of operations per CPU

Re: [R] covariance matrix of the regression coefficients

2007-10-29 Thread Prof Brian Ripley
See ?vcov . On Mon, 29 Oct 2007, Peter B. Mandeville wrote: Greetings, Cohen, Cohen, West, and Aiken 2003 (Applied Multiple Regression-Correlation Analysis for the Behavioral Sciences, Third Edition) on page 273 state the covariance matrix of the regression coefficients is provided by

Re: [R] gam for longitudinal data?

2007-10-29 Thread Julian Burgos
You can use the gamm function (in the mgcv package) to fit generalized additive mixed models and specify your covariance structure. Julian gallon li wrote: I used gam for data analysis a lot. Is it possible to use gam to analyze longitudinal data? I mean, besides the working independence

Re: [R] Qsub - unable to open connection to X11 display

2007-10-29 Thread Bernd Jagla
That is great, bitmap works. Now I have the problem that the gray levels are too bright. I tried using col=black in the hist function, but that only fills the bars. The tick marks etc are all in a fainting gray... Any idea on how to get those darker??? Thanks again, Bernd |-Original

Re: [R] covariance matrix of the regression coefficients

2007-10-29 Thread Peter Dalgaard
Peter B. Mandeville wrote: Greetings, Cohen, Cohen, West, and Aiken 2003 (Applied Multiple Regression-Correlation Analysis for the Behavioral Sciences, Third Edition) on page 273 state the covariance matrix of the regression coefficients is provided by standard programs for multiple

Re: [R] Strange results with anova.glm()

2007-10-29 Thread John Fox
Dear Gustaf, I can think of two reasons why the two tests can disagree. First, the t-test from the summary() output is based on the covariance matrix of the coefficients, while the F-test in the anova() output is based of fitting alternative models. The two are not in general the same.

[R] SavePlot in the Batch mode

2007-10-29 Thread Shubha Vishwanath Karanth
Hi R, Does 'savePlot' will not work in the batch mode? I get the below error: x=c(1,2,3,4,5,6,7) hist(x) savePlot(D:\\Test\\histo,type=jpeg) Error in savePlot(D:\\Test\\histo, type = jpeg) : can only copy from 'windows' devices Execution halted The same works in

Re: [R] lm.boot function gives error

2007-10-29 Thread Peter Dalgaard
Tom La Bone wrote: When I run this calculation library(ISwR) library(simple.boot) data(thuesen) fit - lm(thuesen$short.velocity~thuesen$blood.glucose) summary(fit) fit.sb - lm.boot(fit,R=1000,rows=F) summary(fit.sb) I get the following error from the lm.boot routine:

Re: [R] lm.boot function gives error

2007-10-29 Thread Randa
Indeed it does. The thing that confused me was that lm worked with the odd data names but lm.boot did not. Thanks. Tom -Original Message- From: Peter Dalgaard [mailto:[EMAIL PROTECTED] Sent: Monday, October 29, 2007 4:15 PM To: Tom La Bone Cc: r-help@r-project.org Subject: Re: [R]

[R] How to test combined effects?

2007-10-29 Thread Gang Chen
Suppose I have a mixed-effects model where yij is the jth sample for the ith subject: yij= beta0 + beta1(age) + beta2(age^2) + beta3(age^3) + beta4(IQ) + beta5(IQ^2) + beta6(age*IQ) + beta7(age^2*IQ) + beta8(age^3 *IQ) +random intercepti + eij In R how can I get an F test against the

Re: [R] Adding pagebreaks on files???

2007-10-29 Thread Gavin Simpson
On Mon, 2007-10-29 at 12:36 -0700, Tom.O wrote: Hi Does anyone know if its possible to add pagebreaks to an pdf through an R command? I'm running a loop where each session exports an pdf graph. Each image becomes a separate file, but I would like to have them in the same document but on

[R] Error from lm.fit follow-up

2007-10-29 Thread Maura E Monville
I found myself the reason of the failure. The last row of the matrix input to lm contains all NAs for some reason that I'm going to investigate. I apologize for my previous message. Please, discard it. Sincerely, -- Maura E.M [[alternative HTML version deleted]]

Re: [R] covariance matrix of the regression coefficients

2007-10-29 Thread A. Beaujean
If X is your p-1 variable matrix (with the first column vector being 1s), i.e., nrow(X)=n and ncol(X)=p then MSE-summary(lm(Y~X[2]+X[3] + ...X[P-1]))$s^2 and your coefficient (co)variance matrix is MSE*ginv(t(X)%*%X) Best, Alex On 10/29/07, Peter B. Mandeville [EMAIL PROTECTED] wrote:

Re: [R] covariance matrix of the regression coefficients

2007-10-29 Thread John Fox
Dear Peter, See ?vcov. You could have discovered this via help.search(covariance). I hope this helps, John On Mon, 29 Oct 2007 11:30:11 -0600 Peter B. Mandeville [EMAIL PROTECTED] wrote: Greetings, Cohen, Cohen, West, and Aiken 2003 (Applied Multiple Regression-Correlation Analysis

Re: [R] Converting a string

2007-10-29 Thread Peter Dalgaard
Gang Chen wrote: This must be very simple, but I'm stuck. I have a command line in R defined as a variable of a string of characters. How can I convert the variable so that I can execute it in R? First parse() it then eval() the result -- O__ Peter Dalgaard Øster

[R] Converting a string

2007-10-29 Thread Gang Chen
This must be very simple, but I'm stuck. I have a command line in R defined as a variable of a string of characters. How can I convert the variable so that I can execute it in R? Really appreciate any help, Gang __ R-help@r-project.org mailing list

[R] Adding pagebreaks on files???

2007-10-29 Thread Tom.O
Hi Does anyone know if its possible to add pagebreaks to an pdf through an R command? I'm running a loop where each session exports an pdf graph. Each image becomes a separate file, but I would like to have them in the same document but on separate pages. Does anyone know a solution or

Re: [R] covariance matrix of the regression coefficients

2007-10-29 Thread Doran, Harold
I don't think you ever want to do it this way. vcov() gives what is needed. But, if you perform matrix operations represented algebraically as t(x) %*% x, then use crossprod(x) and NOT t(x) %*% x See the paper at the link below for reasons why @ARTICLE{Rnews:Bates:2004, author = {Douglas

Re: [R] Converting a string

2007-10-29 Thread jim holtman
Can you provide an example of your input and what you expect the output to be. You can always use 'as.numeric'. On 10/29/07, Gang Chen [EMAIL PROTECTED] wrote: This must be very simple, but I'm stuck. I have a command line in R defined as a variable of a string of characters. How can I convert

[R] lm.boot function gives error

2007-10-29 Thread Tom La Bone
When I run this calculation library(ISwR) library(simple.boot) data(thuesen) fit - lm(thuesen$short.velocity~thuesen$blood.glucose) summary(fit) fit.sb - lm.boot(fit,R=1000,rows=F) summary(fit.sb) I get the following error from the lm.boot routine: newdata' had 100 rows but

Re: [R] Converting a string

2007-10-29 Thread Bert Gunter
... Of course if arg1 and arg2 are expressions (as characters strings) that themselves contain commas, then this won't work. So the poster does, indeed, seem to have achieved near obfuscation optimality. Of course this is yet another case where Lumley's principle (at least I think it's his)

Re: [R] Converting a string

2007-10-29 Thread Gang Chen
Thanks for the help. One case is like this: With function MyFunc(Argument1, Argument2, ...) I have the first two arguments defined as one variable tempstr, a string of characters, like tempstr - Argument1, Argument2 The question is how I can feed tempstr into MyFunc to make it executable?

Re: [R] Converting a string

2007-10-29 Thread jim holtman
Here is a way of using parse and eval that was previously mentioned. It works with constants, variable names or expressions: myFunc - function(arg1, arg2) arg1+arg2 x - 20 y - 10 myFunc(x,y) [1] 30 tempstr - 'x,y' # split the string args - strsplit(tempstr, ',') # parse and eval the

Re: [R] Converting a string

2007-10-29 Thread Tim Calkins
Hi - you can split the string using strsplit(). if your function uses Argument1 as a string, then you're all set. If that's not the case then you can get() the object. myfunc - function(arg1, arg2) { + arg1 - get(arg1) + arg2 - get(arg2) ... } args - argument1,argument2 # easier with no

Re: [R] Adding pagebreaks on files???

2007-10-29 Thread Julian Burgos
I do this all the time. Simply, a) Open your pdf file using the pdf function. b) Do a bunch of plots. Because now the pdf file is your active device, every time you call a new plot you should get a new page. You can also use par(mfrow=...) to split the page (the same way you do it on a

[R] VGAM and vglm

2007-10-29 Thread Ted Harding
Hi Folks, I wonderif someone who is familiar with the details of vglm in the VGAM package can assist me. I'm new to using it, and there doesn;t seem much in the documentation that's relevant to the question below. Say I have a vector x of 0/1 responses and another vector y of 0/1 responses, these

Re: [R] Package Installer Fails in OSX 10.5 Leopard

2007-10-29 Thread JimBarritt
Hi Don, I am having exactly the same issue - would you mind providing some details about how you were able to run each of the packages seperately on here ? cheers Jim Don Kalar wrote: Mark, Thanks for your suggestions - I was able to install R by running each of the individual

Re: [R] Converting a string

2007-10-29 Thread Julian Burgos
I'm not sure what you mean. You should provide an example (i.e. some code). Julian Gang Chen wrote: This must be very simple, but I'm stuck. I have a command line in R defined as a variable of a string of characters. How can I convert the variable so that I can execute it in R? Really

Re: [R] jEdit for R

2007-10-29 Thread Michael Lawrence
On 10/26/07, John Thaden [EMAIL PROTECTED] wrote: Michael, Where can we read you document that includes various ideas going far beyond simply embedding R? What about Julian's opinion that Tinn-R is more stable and loads more quickly than jEdit? Can that be true in a Windows

Re: [R] using survfit

2007-10-29 Thread David Winsemius
raymond chiruka wrote: hie when i use plot.survfit to plot more than one graph why I only see the last graph how do i see the other graphs.for example n=20 n1=n/2 n2=n/4 a11=4;a12=4 ;a21=4 ;a22=4 t1-array(1,c(n1))

Re: [R] Package Installer Fails in OSX 10.5 Leopard

2007-10-29 Thread JimBarritt
oops i see i was missing the packages directory which is in the DMG... everything installs fine from there. incidentally i was recieving a message something like this package is already installed sometimes from the main installer. cheers Jim JimBarritt wrote: Hi Don, I am having

Re: [R] gradient and Hessian from lmer2

2007-10-29 Thread Abdus Sattar
Dear R-user: Could you please tell me how to extract gradient and Hessian from the following example model of lmer2 package? (fm1 - lmer(Reaction ~ Days + (Days|Subject), sleepstudy)) I would really appreciate your kind help. Best, Sattar

Re: [R] Appropriate measure of correlation with'zero-inflated' data?

2007-10-29 Thread Douglas Bates
I have created some slides on the Bowl Championship series data for my class. Copies of just that part are available in http://www.stat.wisc.edu/~bates/BCS.zip Two interesting things about the analysis are that a parallel coordinate plot shows the differences in agreement quite clearly and that

Re: [R] Regression query ...

2007-10-29 Thread David Winsemius
Rob Hodgkinson wrote: Forgive me, I do not yet use R nor is it (yet) installed on my machine. I just need an answer to whether (and how ?) R is able to do Ordinary Least Squares (OLS) Regression with the requirement that the regressed line must pass through the origin. When you enter ?lm

  1   2   >