[R] R-squared in Logistic Regression

2005-03-29 Thread Johan Stenberg
Dear all, How do I make R show the R-squared (deviance explained by the model) in a logistic regression? Below is how I write my syntax. Basically I want to investigate density-dependence in parasitism of larvae. Note that in the end I perform a F-test because the dispersion factor (residual

Re: [R] mixed model question

2005-03-29 Thread Dimitris Rizopoulos
probably you could fit this model using the 'varIdent()' function for the 'weights' argument of the 'lme()' function in package nlme. I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address:

[R] Plot Moran's I

2005-03-29 Thread Chloe ARCHINARD
Hello all, I'm a new user of R and I have used the spdep package to calculate Moran's I estimates. I used the dnearneigh() function and moran.test() function and obtained what I wanted, but now I want to plot my results with the p-values. I regrouped my results for the Moran's I like

[R] strange result of acos

2005-03-29 Thread Klaus-Peter Pleissner
Hi all, I have to calculate an expression using acos -function. A strange result of acos appears *1. case with error* ss - sin(10.74*pi/180)**2 +(cos(10.74*pi/180)*cos(10.74*pi/180)*cos(0*pi/180)) ss acos(ss) [1] NaN Warning message: NaNs produced in: acos(ss) *2. case without error* ss -

RE: [R] strange result of acos

2005-03-29 Thread Ted Harding
On 29-Mar-05 Klaus-Peter Pleissner wrote: Hi all, I have to calculate an expression using acos -function. A strange result of acos appears *1. case with error* ss - sin(10.74*pi/180)**2 +(cos(10.74*pi/180)*cos(10.74*pi/180)*cos(0*pi/180)) ss acos(ss) [1] NaN Warning message:

RE: [R] strange result of acos

2005-03-29 Thread Ted Harding
On 29-Mar-05 Ted Harding wrote: The explanation is: sin(10.74*pi/180)**2 +(cos(10.74*pi/180)*cos(10.74*pi/180) *cos(0*pi/180)) -1 [1] 2.220446e-16 I.e. the expression, as internally evaluated, is very slightly greater than 1. When you multiply ss by 0.9, you bring it back

Re: [R] R-squared in Logistic Regression

2005-03-29 Thread Henric Nilsson
On Ti, 2005-03-29, 10:56, Johan Stenberg skrev: How do I make R show the R-squared (deviance explained by the model) in a logistic regression? Several definitions of R^2 exists in the GLM case. See e.g. Menard, S. (2000) Coefficients of determination for multiple logistic regression

Re: [R] R-squared in Logistic Regression

2005-03-29 Thread Frank E Harrell Jr
Johan Stenberg wrote: Dear all, How do I make R show the R-squared (deviance explained by the model) in a logistic regression? Below is how I write my syntax. Basically I want to investigate density-dependence in parasitism of larvae. Note that in the end I perform a F-test because the dispersion

[R] Help about PLS

2005-03-29 Thread Caroline TRUNTZER
Dear all, I would like to use the PLS method to reduce the dimension of my data because there are much more variables that individuals. I looked at the pcr.pls package. Do someone know if there is a mean to project a new individual in the latent variables space (as supplementary point)? Thank you

[R] pairewise plots

2005-03-29 Thread Hai Lin
Dear R users, I have a data generated as the following, dat - data.frame(matrix(sample(24), nrow=4)) dimnames(dat) -list(rownames=c('g1','g2','g3','g4'), colnames=c(A_CH1,A_CH2,B_CH1,B_CH2,C_CH3,C_CH3)) » dat A_CH1 A_CH2 B_CH1 B_CH2 C_CH3 C_CH3 g11624 7 91420 g2

Re: [R] pairewise plots

2005-03-29 Thread Duncan Murdoch
On Tue, 29 Mar 2005 06:58:51 -0800 (PST), Hai Lin [EMAIL PROTECTED] wrote : Dear R users, I have a data generated as the following, dat - data.frame(matrix(sample(24), nrow=4)) dimnames(dat) -list(rownames=c('g1','g2','g3','g4'), colnames=c(A_CH1,A_CH2,B_CH1,B_CH2,C_CH3,C_CH3)) » dat

RE: [R] pairewise plots

2005-03-29 Thread Liaw, Andy
Something like this should do it: invisible(lapply(seq(1, length(dat), by=2), function(i) plot(dat[[i]]+dat[[i+1]], dat[[i]] - dat[[i+1]]))) Andy From: Hai Lin Dear R users, I have a data generated as the following, dat - data.frame(matrix(sample(24), nrow=4))

Re: [R] Annotation metadata kills help.search

2005-03-29 Thread Seth Falcon
Hi Gerard, Gerard Tromp [EMAIL PROTECTED] writes: OS: Windows R 2.0.1 As of about a week ago the help.search function dies when used in the simple help.search(something) usage. The error is Error in rbind(...) : number of columns of matrices must match (see arg 203) After some effort I

Re: [R] pairewise plots

2005-03-29 Thread Petr Pikal
Hallo On 29 Mar 2005 at 6:58, Hai Lin wrote: Dear R users, I have a data generated as the following, dat - data.frame(matrix(sample(24), nrow=4)) dimnames(dat) -list(rownames=c('g1','g2','g3','g4'), colnames=c(A_CH1,A_CH2,B_CH1,B_CH2,C_CH3,C_CH3)) dat A_CH1 A_CH2 B_CH1 B_CH2

Re: [R] pairewise plots

2005-03-29 Thread Dimitris Rizopoulos
you could try something like this: dat - array(sample(24), dim=c(4,2,3)) par(mfrow=c(3,1)) apply(dat, 3, function(x) plot(rowSums(x), x[,2]-x[,1])) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven

Re: [R] pairewise plots

2005-03-29 Thread Deepayan Sarkar
On Tuesday 29 March 2005 08:58, Hai Lin wrote: Dear R users, I have a data generated as the following, dat - data.frame(matrix(sample(24), nrow=4)) dimnames(dat) -list(rownames=c('g1','g2','g3','g4'), colnames=c(A_CH1,A_CH2,B_CH1,B_CH2,C_CH3,C_CH3)) dat A_CH1 A_CH2 B_CH1 B_CH2 C_CH3

Re: [R] Multi-plot figures with different numbers of plots indifferent rows

2005-03-29 Thread Earl F. Glynn
Anne York [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] par(mfrow=c(2,3)) #set up 2 rows x 3 colums plot(1:10) #plot 1 plot(1:10) #plot 2 plot(1:10) #plot 3 par(mfg=c(2,2)) # start next plot at 2,2 instead of 2,1 plot(1:10) # 4th plot If you want to leave the last

[R] Problem installing packages and weird R site behaviour

2005-03-29 Thread Hanke, Alex
Hi, I tried to install a package using the menu option and was presented a list filled with NA's. I then tried visiting the R site and each option on the side bar (eg. CRAN, Search,FAQ) sends me to the address attached below (NB: I left off the h in http). The first problem seems to be related to

[R] regression tree xerror

2005-03-29 Thread Sherri Miller
I am running some models (for the first time) using rpart and am getting results I don't know how to interpret. I'm using cross-validation to prune the tree and the results look like: Root node error: 172.71/292 = 0.59148 n= 292 CP nsplit rel error xerror xstd 1 0.124662 0

Re: [R] Tool for update

2005-03-29 Thread Vincent Goulet
Le 25 Mars 2005 16:12, abunn a écrit : For what I understand you run this every time you use R on a Tuesday, which is not what I would want. What's wrong with Tuesday? Indeed, it's not the ideal solution but has kept me up-to-date. What has amazed me is that I think I've used R every

[R] Stratified Bootstrap question

2005-03-29 Thread qiana
Dear R users, I have a question regarding stratified bootstrap question and how to implement it using boot() in R's boot package. My dataset is a longitudinal dataset (3 measurements per person at year 1, 4 and 7) composed of multiple clinic centers and multiple participants within each clinic.

Re: [R] Problem installing packages and weird R site behaviour

2005-03-29 Thread Peter Dalgaard
Hanke, Alex [EMAIL PROTECTED] writes: Hi, I tried to install a package using the menu option and was presented a list filled with NA's. I then tried visiting the R site and each option on the side bar (eg. CRAN, Search,FAQ) sends me to the address attached below (NB: I left off the h in

RE: [R] Tool for update

2005-03-29 Thread abunn
I think what Prof. Ripley meant is: you have to run R on a Tuesday in order to update your packages. You could lift this requirement --- and still update on Tuesdays --- by using a cron job instead. (That's assuming you're using a Unix variant, I suppose there is some equivalent way to

[R] Re: follow up on pairewise plots

2005-03-29 Thread Hai Lin
--- Dimitris Rizopoulos [EMAIL PROTECTED] wrote: you could try something like this: dat - array(sample(24), dim=c(4,2,3)) par(mfrow=c(3,1)) apply(dat, 3, function(x) plot(rowSums(x), x[,2]-x[,1])) ## Thank you all for the inputs. It's great of help. The above solution also opens my mind

Re: [R] regression tree xerror

2005-03-29 Thread Luis Torgo
Sherri Miller wrote: I am running some models (for the first time) using rpart and am getting results I don't know how to interpret. I'm using cross-validation to prune the tree and the results look like: Root node error: 172.71/292 = 0.59148 n= 292 CP nsplit rel error xerror xstd 1

Re: [R] Annotation metadata kills help.search

2005-03-29 Thread Seth Falcon
Seth Falcon [EMAIL PROTECTED] writes: Hi Gerard, Gerard Tromp [EMAIL PROTECTED] writes: OS: Windows R 2.0.1 As of about a week ago the help.search function dies when used in the simple help.search(something) usage. The error is Error in rbind(...) : number of columns of matrices must

[R] final stages of installing R - please help?

2005-03-29 Thread Jeffrey Gruen, M.D.
Hello, This morning I downloaded, unzipped, and compiled the latest version of R for unix, in my HOME/APPLICATIONS directory. My current unix machine is a sparc-sun-solaris2.9, running SunOS 5.9. Here are the last few lines of the output following ./configure: R is now configured for

[R] dependency help for FC2 rpm

2005-03-29 Thread Steve Sherman
I am having difficulty with dependencies for the R rpm for Fedora Core 2. In attempting to load R-2.0.0.0.fdr.1.fc2.i386.rpm it fails the libtk8.4.so dependency even though I have this library loaded. The library is located in: /usr/local/lib. How might I tell R where to find this library? I

Re: [R] final stages of installing R - please help?

2005-03-29 Thread Peter Dalgaard
Jeffrey Gruen, M.D. [EMAIL PROTECTED] writes: Hello, This morning I downloaded, unzipped, and compiled the latest version of R for unix, in my HOME/APPLICATIONS directory. My current unix machine is a sparc-sun-solaris2.9, running SunOS 5.9. Here are the last few lines of the output

Re: [R] dependency help for FC2 rpm

2005-03-29 Thread Peter Dalgaard
Steve Sherman [EMAIL PROTECTED] writes: I am having difficulty with dependencies for the R rpm for Fedora Core 2. In attempting to load R-2.0.0.0.fdr.1.fc2.i386.rpm it fails the libtk8.4.so dependency even though I have this library loaded. The library is located in: /usr/local/lib. How

[R] Lattice - parallel: xlim and adding lines

2005-03-29 Thread T.A.Wassenaar
Hi, I'm trying to set the minimum and maximum in a parallel plot, but trying xlim=c(-1,1) gives strange results. Am I missing something? The call I give is: parallel(~X[,c(6,9,12,15,18)]|X$ff,X,panel=panel.parallel.new,groups=X$protein,layout=c(3,1),xlim=c(-1,1)) Besides, I would like to add a

Re: [R] Lattice - parallel: xlim and adding lines

2005-03-29 Thread Sundar Dorai-Raj
T.A.Wassenaar wrote on 3/29/2005 2:17 PM: Hi, I'm trying to set the minimum and maximum in a parallel plot, but trying xlim=c(-1,1) gives strange results. Am I missing something? The call I give is:

[R] matching vectors against vectors

2005-03-29 Thread Piet van Remortel
Hi all. I have a re-occuring typical problem that I don't know how to solve efficiently. The situation is the following: I have a number of data-sets (A,B,C,...) , consisting of an identifier (e.g. 11,12,13,...,20) and a measurement (e.g. in the range 100-120). I want to compile a large

[R] slide show with R

2005-03-29 Thread George_Heine
Trying to use R to build an interactive slide show, to be displayed on a projector. The purpose of the presentation is to show how one could construct a simple graph using R. It is meant as a general overview rather than as detailed instruction. For example, something like the following

RE: [R] slide show with R

2005-03-29 Thread Berton Gunter
One possible strategy: see ?readLines Write a text file with your R commands. Then write a little function that opens a connection to the file and runs a loop to: 1)read a line from your file via readLines 2) cat() the line on your terminal 3) prompt via readline to execute it. You'll have to

RE: [R] slide show with R

2005-03-29 Thread Berton Gunter
Oops, I should have said that you can execute the text line via the construction: eval(parse(text=textline)) -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA The business of the statistician is to catalyze the scientific learning process. - George E. P. Box

Re: [R] slide show with R

2005-03-29 Thread Michaell Taylor
Seems like emacs-ess would do the trick. You can read in the entire file - formatted or spaced as appropriate - execute one line or several at a time and see the results in real time. Obviously less a slide show than an R session, but that seems to be what you want. A more canned slide show

[R] Mosaicplot with different colors

2005-03-29 Thread Jan Sabee
This dataset below is one sample answer the questioner from our customer. testbank - read.table(testbank.txt, header=T) testbank age married income gender ownhouse class 1 20-30 no high female yes 1st 2 30-40 no high female yes 1st 3 40-50 nolow

RE: [R] Aggregating data (with more than one function)

2005-03-29 Thread Robin Schroeder
Dear list Andy, I am hopelessly stumped, how would one add the department names as a variable? Robin Robin Tori Schroeder International Institute for Sustainability P.O. Box 873211 Arizona State University Tempe, Arizona 85287-3211 Phone: (480) 727-7290 -Original Message-

Re: [R] Mosaicplot with different colors

2005-03-29 Thread Achim Zeileis
On Tue, 29 Mar 2005, Jan Sabee wrote: This dataset below is one sample answer the questioner from our customer. testbank - read.table(testbank.txt, header=T) testbank age married income gender ownhouse class 1 20-30 no high female yes 1st 2 30-40 no high

Re: [R] Lattice - parallel: xlim and adding lines

2005-03-29 Thread T.A.Wassenaar
Hi Sundar, Thanks for the reply. And, oops, the panel.parallel.new shouldn't be in there. That is a revised panel function to color according to a group. As with strange, that would generally be 'not-expected', i.e., in the present case, not having an x-axis running from -1 to 1 for all

Re: [R] slide show with R

2005-03-29 Thread Greg Snow
Another approach is to put your commands below into a text file. Add a line like: tmp - readline('Press Enter to Continue:') everywhere you want to pause. Then do: source('path/to/text/file', echo=T) it will print out the commands and execute them, but everytime it gets to the tmp - ...

Re: [R] Multi-plot figures with different numbers of plots indifferent rows

2005-03-29 Thread Paul Murrell
Hi Earl F. Glynn wrote: Anne York [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] par(mfrow=c(2,3)) #set up 2 rows x 3 colums plot(1:10) #plot 1 plot(1:10) #plot 2 plot(1:10) #plot 3 par(mfg=c(2,2)) # start next plot at 2,2 instead of 2,1 plot(1:10) # 4th plot If you want to

Re: [R] Multi-plot figures with different numbers of plots indifferentrows

2005-03-29 Thread Earl F. Glynn
Paul Murrell [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... Does this do what you want? layout(rbind(c(1, 2, 3), c(0, 4, 0))) plot(1:10, main=Plot 1) plot(1:20, main=Plot 2) plot(1:30, main=Plot 3) plot(1:40, main=Plot 4) # new page! plot(1:40, main=Plot 5)

Re: [R] Lattice - parallel: xlim and adding lines

2005-03-29 Thread Sundar Dorai-Raj
T.A.Wassenaar wrote on 3/29/2005 4:17 PM: Hi Sundar, Thanks for the reply. And, oops, the panel.parallel.new shouldn't be in there. That is a revised panel function to color according to a group. As with strange, that would generally be 'not-expected', i.e., in the present case, not having an

[R] From FAQ 7.21 to a command like apply(sapply(list(f1,f2,f3),is.na),2,sum)

2005-03-29 Thread Heinz Tuechler
Dear all, Last December there was a thread regarding the famous FAQ 7.21 How can I turn a string into a variable? and asking what people want to do with these strings. My, certainly trivial application would be as follows: Assume I have a data.frame containing besides others also the columns f1,

Re: [R] matching vectors against vectors

2005-03-29 Thread Pierre Kleiber
merge() may be just what you want. Cheers, Pierre Piet van Remortel wrote: Hi all. I have a re-occuring typical problem that I don't know how to solve efficiently. The situation is the following: I have a number of data-sets (A,B,C,...) , consisting of an identifier (e.g. 11,12,13,...,20)

Re: [R] Lattice - parallel: xlim and adding lines

2005-03-29 Thread Deepayan Sarkar
On Tuesday 29 March 2005 17:04, Sundar Dorai-Raj wrote: T.A.Wassenaar wrote on 3/29/2005 4:17 PM: Hi Sundar, Thanks for the reply. And, oops, the panel.parallel.new shouldn't be in there. That is a revised panel function to color according to a group. As with strange, that would

Re: [R] From FAQ 7.21 to a command like apply(sapply(list(f1, f2, f3), is.na), 2, sum)

2005-03-29 Thread Thomas Lumley
On Wed, 30 Mar 2005, Heinz Tuechler wrote: Dear all, Last December there was a thread regarding the famous FAQ 7.21 How can I turn a string into a variable? and asking what people want to do with these strings. My, certainly trivial application would be as follows: Assume I have a data.frame

[R] Is there a convenient function that can check if a vector is a subset of another one?

2005-03-29 Thread Terry Mu
x - 2:5 y - 1:10 Is there something like: is.subset(x, y) == T Thank you, __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] discriminant function analysis in R

2005-03-29 Thread Jason Miller
Dear R Users, I'm very very interested in learning how to use R to carry out a classification of data using discriminant function analysis. I've found the MASS package and the lda function, but the examples in the help system are a bit over my head. I'm not exactly sure how to interpret the

Re: [R] Is there a convenient function that can check if a vector is a subset of another one?

2005-03-29 Thread Pierre Kleiber
all(x %in% y) should do what you want: x - 2:5 y - 1:10 all(x %in% y) [1] TRUE all(y %in% x) [1] FALSE Cheers, Pierre Terry Mu wrote: x - 2:5 y - 1:10 Is there something like: is.subset(x, y) == T Thank you, __ R-help@stat.math.ethz.ch mailing list

[R] help with plotting a grid on levelplot

2005-03-29 Thread Jeff D. Hamann
I'm trying to plot a grid over a levelplot print( levelplot( var1.pred~x+y, data=saw.pred, aspect=mapasp(saw.pred), col.regions=terrain.colors(80), main=main) ) using the data... saw.pred x y var1.pred var1.var sort 1 5 5

RE: [R] Aggregating data (with more than one function)

2005-03-29 Thread Liaw, Andy
agg.dat - do.call(rbind, by(dat$Salary, dat$Department, +function(x) c(mean=mean(x), total=sum(x agg.dat - data.frame(dept=rownames(agg.dat), agg.dat) agg.dat dept mean total Finance Finance 83925.67 251777 HR HR 6.33 19 IT IT

Re: [R] slide show with R

2005-03-29 Thread max.marinucci
Why don't use R-Winedt package? If you have Winedt installed on your machine, it does something similar to what you want. Just highlight the command you want to execute from a text command file and then press the R-paste button. Good luck! M. **

RE: [R] dependency help for FC2 rpm

2005-03-29 Thread ssherman
That worked great. Thank you. = Original Message From Peter Dalgaard [EMAIL PROTECTED] = Steve Sherman [EMAIL PROTECTED] writes: I am having difficulty with dependencies for the R rpm for Fedora Core 2. In attempting to load R-2.0.0.0.fdr.1.fc2.i386.rpm it fails the libtk8.4.so

Re: [R] help with plotting a grid on levelplot

2005-03-29 Thread Deepayan Sarkar
On Tuesday 29 March 2005 19:16, Jeff D. Hamann wrote: I'm trying to plot a grid over a levelplot print( levelplot( var1.pred~x+y, data=saw.pred, aspect=mapasp(saw.pred), col.regions=terrain.colors(80), main=main) ) using

[R] Base and lattice graphics on the same graphics page

2005-03-29 Thread John Maindonald
Although base graphics does not mix with lattice in the one graph, I've found that print.trellis(position=..., ) and the use of par(fig=...) to put regular and trellis graphics on the one graphics page works like a treat, at least in version 2.0.1 of R. [Base graphics functions that are

Re: [R] Base and lattice graphics on the same graphics page

2005-03-29 Thread Deepayan Sarkar
On Tuesday 29 March 2005 22:32, John Maindonald wrote: Although base graphics does not mix with lattice in the one graph, I've found that print.trellis(position=..., ) and the use of par(fig=...) to put regular and trellis graphics on the one graphics page works like a treat, at least in

[R] how i can get input from user input

2005-03-29 Thread Cuichang Zhao
Hello, Could you please tell me how i can get an input from the user in R? C-Ming Mar 29, 2005 - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list

[R] 2d plotting and colours

2005-03-29 Thread Asha Jayanthi
Hi! I am new to R just 3 days in it and i apologize if my questions seem very trivial and consumed your valuable time. I am coding in perl and i stumbled upon R regarding plotting good statistical graphs. I tried the kmean clustering for a large matrix ,say 150 * 150 . I tried the example

Re: [R] dependency help for FC2 rpm

2005-03-29 Thread Yuandan Zhang
On 29 Mar 2005 22:04:51 +0200 Peter Dalgaard [EMAIL PROTECTED] wrote: Steve Sherman [EMAIL PROTECTED] writes: I am having difficulty with dependencies for the R rpm for Fedora Core 2. In attempting to load R-2.0.0.0.fdr.1.fc2.i386.rpm it fails the libtk8.4.so dependency even though I

Re: [R] how i can get input from user input

2005-03-29 Thread Uwe Ligges
Cuichang Zhao wrote: Hello, Could you please tell me how i can get an input from the user in R? Depends on the kind of input. See, e.g., ?scan or ?menu Uwe Ligges C-Ming Mar 29, 2005 - [[alternative HTML version deleted]]

Re: [R] 2d plotting and colours

2005-03-29 Thread TEMPL Matthias
Hi! There are more than 8 colors. x - rbind(matrix(rnorm(100, sd = 0.3), ncol = 2), matrix(rnorm(100, mean = 1, sd = 0.3), ncol = 2)) (cl - kmeans(x, i, 20)) s - c(tomato4, turquoise, slateblue, wheat, snow, skyblue, peru, pink) # see at: colors() plot(x, col

Re: [R] 2d plotting and colours

2005-03-29 Thread Uwe Ligges
TEMPL Matthias wrote: Hi! There are more than 8 colors. Yes, e.g. for rgb space there are 16777216, see ?rgb. Uwe Ligges x - rbind(matrix(rnorm(100, sd = 0.3), ncol = 2), matrix(rnorm(100, mean = 1, sd = 0.3), ncol = 2)) (cl - kmeans(x, i, 20)) s - c(tomato4, turquoise,