Re: [R] Dataset on Baltimore home energy costs

2006-10-21 Thread Richard Graham
elect: Total cost of electricity (including delivery and commodity charges) With Maryland's BGE/PSC/State Legislature rate control, does anybody _really_ know what the total cost is? That may be what you paid then, but was that the total cost? The cost data may be difficult to compare with

Re: [R] binom.test [Broadcast]

2006-10-21 Thread Liaw, Andy
To quote one of the previous answers you've got: The formula you're using is the TV. The one binom.test() uses is the ballpark. Take your pick. Andy From: Ethan Johnsons Thank you for the info. It helps. After all, it would be: 0.1304348-1.96*(sqrt((0.1304348*(1-0.1304348))/46))

[R] plot.mca in MASS

2006-10-21 Thread Marco LO
Hello All, Is it possible to plot each factor in a different color on the multiple correspondence plot? What is the implication and statistical meaning behind the coordinates for the rows on the plot? Could I just plot a symbol instead of a number for the coordinates? Thanks!

[R] plot.POSIXct plot.POSIXlt

2006-10-21 Thread Patrick Giraudoux
Hi, Just to signal that when I want to plot POSIXct variable on x using format within plot(), I get what I want on the plot but with a number of warnings: plot(y~x,format=%y-%m) Warning messages: 1: format is not a graphical parameter in: plot.window(xlim, ylim, log, asp, ...) 2: format is

[R] one is not one

2006-10-21 Thread Patrick Giraudoux
Folks, I have got a strange behaviour when testing this: sum(x) != 1 let us set x-c(70,134,1,5,0) and transform it in a vector of probabilities x-x/sum(x) One expect sum(x) should be equal to 1, which is apparently the case sum(x) [1] 1 However, when I try to test it I get: if(sum(x)

Re: [R] one is not one

2006-10-21 Thread Andrew Robinson
Patrick, the problem arises because computers can't exactly represent real numbers. Try this for your test: if(!all.equal(sum(x),1)) print(lost) else (OK) see FAQ http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f I hope that this helps Andrew

Re: [R] one is not one

2006-10-21 Thread Roger Bivand
On Sat, 21 Oct 2006, Patrick Giraudoux wrote: Folks, I have got a strange behaviour when testing this: sum(x) != 1 FAQ 7.31 Why doesn't R think these numbers are equal?: print(sum(x), digits=20) identical(sum(x), 1) all.equal(sum(x), 1) let us set x-c(70,134,1,5,0) and

Re: [R] Cardinality constraint

2006-10-21 Thread Patrick Burns
To solve the problem you have in general, you will need something more powerful than 'constrOptim'. This is called a mixed integer problem, and arises in several fields including financial portfolio optimization. If you really only have 3 variables, then there are only 3 combinations of 2

[R] Constructing predictions from HPDinterval() after lmer()

2006-10-21 Thread Michael Kubovy
Dear r-helpers, Following up on http://finzi.psych.upenn.edu/R/Rhelp02a/archive/ 81159.html where Douglas Bates gives a helpful application of lmer() to data(sleepstudy, package = 'lme4'), I need a bit more help in order to plot the correct confidence intervals of a designed experiment

Re: [R] one is not one

2006-10-21 Thread Philipp Pagel
On Sat, Oct 21, 2006 at 11:04:13AM +0200, Patrick Giraudoux wrote: Which means that actually sum(x) is NOT considered equal to 1... Any idea about what is going wrong? Others have already pointed out the problem and I would like to add a reference to a classical paper on this topic: David

[R] Problems running IsoMDS using vegdist with pres-abs data and two sites with zero distance

2006-10-21 Thread Leonard Sandin
Hi I have just (finally) started to poke around in R and wanted to analyse a stream fish dataset with 28 sites and 18 species. When trying to follow the Vegan manual to run nmds from distance measures calculated by the vegdist function it turns out that I have two sites (streams) with the

[R] ReadLines question

2006-10-21 Thread Jonathan Greenberg
I'm getting the following error: headerinfo=readLines(met_station_file,n=8) headerinfo [1] Plot Title: tahoe met validation ,,, [2]Error: invalid multibyte string met_station_file's first 8 lines are as follows: Plot Title: tahoe met validation ,,, #,Time, GMT-07:00,Temp, ƒF,Coupler

Re: [R] ReadLines question

2006-10-21 Thread Roger Bivand
On Sat, 21 Oct 2006, Jonathan Greenberg wrote: I'm getting the following error: headerinfo=readLines(met_station_file,n=8) headerinfo [1] Plot Title: tahoe met validation ,,, [2]Error: invalid multibyte string met_station_file's first 8 lines

Re: [R] Problems running IsoMDS using vegdist with pres-abs data and two sites with zero distance

2006-10-21 Thread Gavin Simpson
On Sat, 2006-10-21 at 13:19 +0200, Leonard Sandin wrote: Hi I have just (finally) started to poke around in R and wanted to analyse a stream fish dataset with 28 sites and 18 species. When trying to follow the Vegan manual to run nmds from distance measures calculated by the vegdist

Re: [R] Dataset on Baltimore home energy costs

2006-10-21 Thread Zembower, Kevin
Sorry, dumb typo. Should be 18-Dec-2005. -Kevin From: Richard M. Heiberger [mailto:[EMAIL PROTECTED] Sent: Fri 10/20/2006 5:43 PM To: Zembower, Kevin Subject: Re: [R] Dataset on Baltimore home energy costs Thanks for the data. Can you clarify the date here.

[R] Filling in a series

2006-10-21 Thread Dennis Fisher
Colleagues After reading in some clinical data, I discovered that the subject ID column contains entries only for the first record for each individual; subsequent rows are recorded as NA. For example: 1 NA NA NA NA 2 NA NA NA NA 3 NA NA ... I can think of various approaches to

Re: [R] Filling in a series

2006-10-21 Thread Gabor Grothendieck
The zoo package has na.locf (last occurrernce carried foward) for this purpose: x [1] 1 NA NA NA NA 2 NA NA NA NA 3 NA NA library(zoo) na.locf(x) [1] 1 1 1 1 1 2 2 2 2 2 3 3 3 On 10/21/06, Dennis Fisher [EMAIL PROTECTED] wrote: Colleagues After reading in some clinical data, I

Re: [R] Filling in a series

2006-10-21 Thread Gabor Grothendieck
Actually I think its last _observation_ carried forward. On 10/21/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: The zoo package has na.locf (last occurrernce carried foward) for this purpose: x [1] 1 NA NA NA NA 2 NA NA NA NA 3 NA NA library(zoo) na.locf(x) [1] 1 1 1 1 1 2 2 2 2

[R] newbie question

2006-10-21 Thread Larry White
Sorry - this must be obvious, but i haven't been able to find the answer in the guides i've searched. The examples seem to assume you always want to look at all the data. I want to be able to filter data in a dataframe before analyzing it. For example, I'd like to plot(a,b) but only include

Re: [R] newbie question

2006-10-21 Thread Paul Hiemstra
Dear Larry, Data can be filtered in the following manner: a = c(1,2,3,4) b = c(1,2,3,4) b = b[a3] b = b[b3] a b [1] 4 Or if the data is in a data frame: b = data.frame(seq(1:10),seq(1:10) names(b) = c(a,b) b b = b[b$a 5,] b The trailing comma at the end is important. Hopes this helps, Paul

[R] logistic regression with a sample missing subjects with a value of an independent variable

2006-10-21 Thread Gabriele Stocco
Dear R-help, I am trying to make logistic regression analysis using the R function glm, with the parameter family set to binomial, in order to use a logistic regression model. I have 70 samples. The dependent variables has two levels (0 and 1) and one of the independent variables has too two

[R] problem with mode of marginal distriubtion of rdirichlet{gtools}

2006-10-21 Thread hong qin
Hi all, I have a problem using rdirichlet{gtools}. For Dir( a1, a2, ..., a_n), its mode can be found at $( a_i -1)/ ( \sum_{i}a_i - n)$; The means are $a_i / (\sum_{i} a_i ) $; I tried to study the above properties using rdirichlet from gtools. The code are: ## library(gtools)

Re: [R] newbie question

2006-10-21 Thread Chuck Cleland
Larry White wrote: Sorry - this must be obvious, but i haven't been able to find the answer in the guides i've searched. The examples seem to assume you always want to look at all the data. I want to be able to filter data in a dataframe before analyzing it. For example, I'd like to

Re: [R] logistic regression with a sample missing subjects with a value of an independent variable

2006-10-21 Thread Prof Brian Ripley
On Sat, 21 Oct 2006, Gabriele Stocco wrote: Dear R-help, I am trying to make logistic regression analysis using the R function glm, with the parameter family set to binomial, in order to use a logistic regression model. I have 70 samples. The dependent variables has two levels (0 and 1) and

[R] Box's M test

2006-10-21 Thread GRAHAM LEASK
Dear List I am looking for a script that will calculate the Box M test to test the homogeneity of the variance/covariance matrix between two matrices. If anyone could send me the script I would appreciate it. I am aware of the scepticism about this test, where due to extreme

[R] Box M test

2006-10-21 Thread GRAHAM LEASK
Dear List I am looking for a script that will calculate the Box M test to test the homogeneity of the variance/covariance matrix between two matrices. If anyone could send me the script I would appreciate it. I am aware of the scepticism about this test, where due to extreme

[R] how do I find the row index number, or row name, of a given value in a vector?

2006-10-21 Thread tom soyer
Hi, I noticed that max(x) returns the maximum value of a vector, but the function doesn't give the user the option of retrieving the row index number instead. If I used max(x) to find the maximum value of vector x, then is there a function I can use to find the index number, or row name, of the

Re: [R] newbie question

2006-10-21 Thread Alberto Vieira Ferreira Monteiro
Larry White wrote: Sorry - this must be obvious, Yes, it is :-) I want to be able to filter data in a dataframe before analyzing it. For example, I'd like to plot(a,b) but only include values where b 1000. If a and b are vectors, then b 1000 is another vector of logical values. You can

Re: [R] how do I find the row index number, or row name, of a given value in a vector?

2006-10-21 Thread John Kane
--- tom soyer [EMAIL PROTECTED] wrote: Hi, I noticed that max(x) returns the maximum value of a vector, but the function doesn't give the user the option of retrieving the row index number instead. If I used max(x) to find the maximum value of vector x, then is there a function I can

Re: [R] how do I find the row index number, or row name, of a given value in a vector?

2006-10-21 Thread Gabor Grothendieck
?which.max On 10/21/06, tom soyer [EMAIL PROTECTED] wrote: Hi, I noticed that max(x) returns the maximum value of a vector, but the function doesn't give the user the option of retrieving the row index number instead. If I used max(x) to find the maximum value of vector x, then is there a

Re: [R] how do I find the row index number, or row name, of a given value in a vector?

2006-10-21 Thread tom soyer
Thanks John! I got it. On 10/21/06, John Kane [EMAIL PROTECTED] wrote: --- tom soyer [EMAIL PROTECTED] wrote: Hi, I noticed that max(x) returns the maximum value of a vector, but the function doesn't give the user the option of retrieving the row index number instead. If I used

Re: [R] I really don't understand functions in R :-)

2006-10-21 Thread Marcin Jaworski
Patrick Burns ([EMAIL PROTECTED]) wrote: You may be interested in S Poetry. Hi, I do find your book very helpful. Thank you. Best regards, Marcin Jaworski __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] [Fwd: [AGDG-LIST:405] R Computing Contest]

2006-10-21 Thread Gregor Gorjanc
Original Message Subject: [AGDG-LIST:405] R Computing Contest Date: Sat, 21 Oct 2006 12:08:13 -0400 From: Larry Schaeffer [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Animal Geneticist's Discussion [EMAIL PROTECTED] For those that are interested only: R Computer

Re: [R] ReadLines question

2006-10-21 Thread Jonathan Greenberg
That looks to me like an infinity sign (I have no idea why that is part of the header of this file, but it is there). How do I modify the encoding to read this in? --j On 10/21/06 4:33 AM, Roger Bivand [EMAIL PROTECTED] wrote: On Sat, 21 Oct 2006, Jonathan Greenberg wrote: I'm getting

Re: [R] Box M test [Broadcast]

2006-10-21 Thread Liaw, Andy
See http://finzi.psych.upenn.edu/R/Rhelp02a/archive/0.html Andy From: GRAHAM LEASK Dear List I am looking for a script that will calculate the Box M test to test the homogeneity of the variance/covariance matrix between two matrices. If anyone could send me the

Re: [R] ReadLines question

2006-10-21 Thread Roger Bivand
On Sat, 21 Oct 2006, Jonathan Greenberg wrote: That looks to me like an infinity sign (I have no idea why that is part of the header of this file, but it is there). How do I modify the encoding to read this in? The problem is the degree sign. Under linux: $ file

Re: [R] ReadLines question

2006-10-21 Thread Peter Dalgaard
Roger Bivand [EMAIL PROTECTED] writes: On Sat, 21 Oct 2006, Jonathan Greenberg wrote: That looks to me like an infinity sign (I have no idea why that is part of the header of this file, but it is there). How do I modify the encoding to read this in? The problem is the degree sign.

[R] Possible bugs in 'seek' and 'readBin'

2006-10-21 Thread Zepu Zhang
I found that seek(..., origin = 'current', ...) and readBin(..., what = 'integer', ...) or 'int' do not work correctly. Did anyone have the same experience? __ R-help@stat.math.ethz.ch mailing list

[R] pie

2006-10-21 Thread Dietrich Tissen
Hi, I would like to draw a pie chart. I've already tried out the standard pie-function in the GRAPH-package. My question: is there any 'better' function or package to draw a pie chart. For example I would like to draw a 3D pie chart. Dietrich Tissen

[R] tcltk: multiple listboxes, selection

2006-10-21 Thread JeeBee
Dear list, I have multiple (BWidget) listboxes in the same toplevel window. The problem is, if I select (by left clicking) on one of those listbox elements, the current selection in the *other* listboxes is cleared! Anybody knows how I can prevent this? Here's my code (sorry not complete): (E.g.

Re: [R] pie

2006-10-21 Thread Marc Schwartz
On Sat, 2006-10-21 at 22:46 +0200, Dietrich Tissen wrote: Hi, I would like to draw a pie chart. I've already tried out the standard pie-function in the GRAPH-package. My question: is there any 'better' function or package to draw a pie chart. For example I would like to draw a 3D pie

Re: [R] Latex editor recommendations

2006-10-21 Thread Jens Scheidtmann
Richard M. Heiberger [EMAIL PROTECTED] writes: I recommend emacs http://ftp.gnu.org/pub/gnu/emacs It has modes for TeX and LaTeX and automatically chooses the right one. As a side benefit once you have emacs you can then run R through ESS, the package that provides the modes for handling

Re: [R] Using the ROracle package with Oracle 10 ?

2006-10-21 Thread Jens Scheidtmann
Ram Dessau [EMAIL PROTECTED] writes: [...] Window binary for ROracle 10 ? Is there anyone who could help with a version of ROracle for windows which is compatible with Oracle 10 or more general just uses the default-home The available (not officially released) version only supports Oracle 9

Re: [R] ROracle error in Windows. Memory could not be read.

2006-10-21 Thread Jens Scheidtmann
Adrian Dragulescu [EMAIL PROTECTED] writes: I've seen from earlier posts that other people had problems installing ROracle under Windows. I run R-2.3.1. I got the Windows binaries for ROracle from http://stat.bell-labs.com/RS-DBI/download/index.html Here is my session: require(ROracle)

Re: [R] ReadLines question

2006-10-21 Thread Roger Bivand
On 21 Oct 2006, Peter Dalgaard wrote: Roger Bivand [EMAIL PROTECTED] writes: On Sat, 21 Oct 2006, Jonathan Greenberg wrote: That looks to me like an infinity sign (I have no idea why that is part of the header of this file, but it is there). How do I modify the encoding to

Re: [R] problem with mode of marginal distriubtion of rdiri chlet{gtools}

2006-10-21 Thread Ben Bolker
hong qin alongway at gmail.com writes: Hi all, I have a problem using rdirichlet{gtools}. For Dir( a1, a2, ..., a_n), its mode can be found at $( a_i -1)/ ( \sum_{i}a_i - n)$; The means are $a_i / (\sum_{i} a_i ) $; I believe the problem is that the marginal modes are not equal

[R] object(s) are masked from package - what does it mean?

2006-10-21 Thread tom soyer
Hi, Sometime when I attach a dataset, R gives me the following message/warning:The following object(s) are masked from package:datasets: column_name. Does anyone know what it means? Since it seems that the dataset was attached and I could manipulate the data from the dataset without problems, I

[R] glm function question

2006-10-21 Thread Chris Linton
I am creating a model attempting to predict the probability someone will reoffend after being caught for a crime. There are seven total inputs and I planned on using a logistic regression. I started with a null deviance of 182.91 and ended up with a residual deviance of 83.40 after accounting

Re: [R] glm function question

2006-10-21 Thread Marc Schwartz
On Sat, 2006-10-21 at 20:02 -0400, Chris Linton wrote: I am creating a model attempting to predict the probability someone will reoffend after being caught for a crime. There are seven total inputs and I planned on using a logistic regression. I started with a null deviance of 182.91 and

Re: [R] object(s) are masked from package - what does it mean?

2006-10-21 Thread Gregor Gorjanc
tom soyer tom.soyer at gmail.com writes: Hi, Sometime when I attach a dataset, R gives me the following message/warning:The following object(s) are masked from package:datasets: column_name. Does anyone know what it means? Since it seems that the dataset was attached and I could

[R] Problem with installing Hmisc and Design: gfrotran: error

2006-10-21 Thread Stephan Lindner
cannot exec 'f951': No such file or directory Reply-To: Hi all, I'm using R on an Suse Linux system. Since Hmisc and Design need both fortran, I installed gfortran (through rpm). However, I still get an error message, namely: gfrotran: error cannot exec 'f951': No such file or directory And

[R] how to convert multiple dummy variables to 1 factor variable?

2006-10-21 Thread Wensui Liu
Dear Listers, I am wondering how to convert multiple dummy variables to 1 factor variable. Thanks. wensui __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] glm function question

2006-10-21 Thread Gregor Gorjanc
Chris Linton connect.chris at gmail.com writes: I am creating a model attempting to predict the probability someone will reoffend after being caught for a crime. There are seven total inputs and I planned on using a logistic regression. I started with a null deviance of 182.91 and ended

Re: [R] object(s) are masked from package - what does it mean?

2006-10-21 Thread Marc Schwartz
On Sat, 2006-10-21 at 18:43 -0500, tom soyer wrote: Hi, Sometime when I attach a dataset, R gives me the following message/warning:The following object(s) are masked from package:datasets: column_name. Does anyone know what it means? Since it seems that the dataset was attached and I could

[R] Multilevel model (lme) question

2006-10-21 Thread Lukas Rode
Dear list, I'm trying to fit a multilevel (mixed-effects) model using the lme function (package nlme) in R 2.4.0. As a mixed-effects newbie I'm neither sure about the modeling nor the correct R syntax. My data is structured as follows: For each subject, a quantity Y is measured at a number (= 2)

Re: [R] how to convert multiple dummy variables to 1 factor variable?

2006-10-21 Thread Marc Schwartz
On Sat, 2006-10-21 at 21:04 -0400, Wensui Liu wrote: Dear Listers, I am wondering how to convert multiple dummy variables to 1 factor variable. Thanks. wensui I was thinking of a function that is essentially the reverse of model.matrix() which is used by R modeling functions. I did not

[R] cross tabs with percents?

2006-10-21 Thread Larry White
-- apologies if this is a dup - i got a bounce saying the message was unprocessed. Is there a straightforward way to get a table with percents in the cells rather than counts? I've looked at table, ftable, xtabs, and ctab, which did the conversion but returned the results in a single row without

Re: [R] cross tabs with percents?

2006-10-21 Thread ronggui
Maybe _CrossTable_ in gmodels package is what you want. 2006/10/22, Larry White [EMAIL PROTECTED]: -- apologies if this is a dup - i got a bounce saying the message was unprocessed. Is there a straightforward way to get a table with percents in the cells rather than counts? I've looked at

Re: [R] object(s) are masked from package - what does it mean?

2006-10-21 Thread tom soyer
Thanks Marc and Gregor for the detailed explanation. You are right, the masking is potentially dangerous. Since R is object oriented, I am surprised that this is an issue. Does this mean that encapsulation does not exist in R? On 10/21/06, Marc Schwartz [EMAIL PROTECTED] wrote: On Sat,

Re: [R] cross tabs with percents?

2006-10-21 Thread tom soyer
try prop.table() On 10/21/06, ronggui [EMAIL PROTECTED] wrote: Maybe _CrossTable_ in gmodels package is what you want. 2006/10/22, Larry White [EMAIL PROTECTED]: -- apologies if this is a dup - i got a bounce saying the message was unprocessed. Is there a straightforward way to get

[R] Question:shardsplot (package:klaR)

2006-10-21 Thread ebi
Dear all, I have a question on the shardsplot package:klaR(see the below Example). Plese tell me the meanings of logstand - t((t(logcount) / sdlogcount) * c(1,2,6,5,5,3)), much more. Why does this example use c(1,2,6,5,5,3) ? Examples: # Compute clusters and an Eight Directions

Re: [R] cross tabs with percents?

2006-10-21 Thread Jim Lemon
Larry White wrote: -- apologies if this is a dup - i got a bounce saying the message was unprocessed. Is there a straightforward way to get a table with percents in the cells rather than counts? I've looked at table, ftable, xtabs, and ctab, which did the conversion but returned the results

[R] least median squares

2006-10-21 Thread Pedro Mardones
Does anyone can provide a code to implement least median squares regression in R (not using the lqs function or calling C functions)? Reason: teaching/learning purposes Thanks PM __ R-help@stat.math.ethz.ch mailing list

Re: [R] least median squares

2006-10-21 Thread Gabor Grothendieck
Try this using builtin data set BOD: medsq - function(p, DF) median((p[1] + p[2] * DF[[1]] - DF[[2]])^2) init - coef(lm(demand ~ Time, BOD)) optim(init, medsq, DF = BOD) library(MASS) lqs(demand ~ Time, BOD, method = lms) On 10/22/06, Pedro Mardones [EMAIL PROTECTED] wrote: Does anyone can

Re: [R] currency or stock trading strategy

2006-10-21 Thread Darren Weber
Thanks to everyone for many useful tips to more information.I think this thread is worth reading, if only for that reason alone (despite some disparaging comments about my research abilitites). I appreciate the advice from those who have more experience with these finance tools than me (that