Re: [R] Thinking about using two y-scales on your plot?

2008-04-03 Thread Tribo Laboy
Hi It always nice to follow these discussions. There's always so much to learn. I can't disagree with most of the article that Hadley pointed us to, but still I can see value in double y-axis plots. I even remember using one a few years ago. What was said about the temperature in Celsius and in F

Re: [R] coding for categorical variables with unequal observations

2008-04-03 Thread Prof Brian Ripley
I think you need to do some background reading. R does this automatically for you, and offers many options for how it is done. (That you have asked suggests you have missed that.) The account by Bill Venables in chapter 6 of MASS (the book, see the R FAQ) is regarded as the most comprehensive

[R] markov switching model

2008-04-03 Thread harsu Gie
excuse me, i need your help. introduce my name is harsugi, i have just graduated from my study at Gadjah mada University, Indonesia. I have several Question about using R. 1. I try to solve markov switcing model with R, but i dont know if there any packages discuss about it, can you tell me if

[R] looking for a CDF of bivariate noncentral Chisquare

2008-04-03 Thread Rossita Mohamad Yunus
Hi, I would like to know if there is a program written in R to get the CDF (cumulative distribution function) of a bivariate non-central chi-square distribution. Hope someone will reply. Thank you, Rossita M Yunus [EMAIL PROTECTED] This email (including any attached files) is con

[R] [R-pkgs] ggplot2 - version 0.6

2008-04-03 Thread hadley wickham
ggplot2 ggplot2 is a plotting system for R, based on the grammar of graphics, which tries to take the good parts of base and lattice graphics and avoid bad parts. It takes care of many of the fiddly details that make plotting a hassle (l

Re: [R] newbie subset question

2008-04-03 Thread jim holtman
Use "|" instead of "||". On Thu, Apr 3, 2008 at 6:27 PM, Farley, Robert <[EMAIL PROTECTED]> wrote: > I want to look at all the records making up a "row and column" of a > crosstab, but I'm not getting it right. I'm trying to use subset() but > my selection ((prod_act=="other") || (attr_act=="othe

Re: [R] coding for categorical variables with unequal observations

2008-04-03 Thread Tanya Yatsunenko
Also, since I just started to use R, I have trouble generating and understanding some of the codes, especially choosing the correct ones. Thanks! tanya On Thu, Apr 3, 2008 at 3:54 PM, Tanya Yatsunenko <[EMAIL PROTECTED]> wrote: > Hi, > I am doing multiple regression, and have several X variables

[R] newbie subset question

2008-04-03 Thread Farley, Robert
I want to look at all the records making up a "row and column" of a crosstab, but I'm not getting it right. I'm trying to use subset() but my selection ((prod_act=="other") || (attr_act=="other")) gives my no records. See the second table below. Getting just the row does work, as seen in the thi

Re: [R] How to ask for *fixed* number of distributions under parameterized Gaussian mixture model.

2008-04-03 Thread Wensui Liu
Hi, Chen, I don't know how you are doing it. however, per my limited knowledge, it is easy with flexmix package. On Thu, Apr 3, 2008 at 6:26 AM, Hung-Hsuan Chen (Sean) <[EMAIL PROTECTED]> wrote: > Dear R users: > I am wondering how to ask for *fixed* number of distributions under > parameteriz

Re: [R] convert data frame values

2008-04-03 Thread Peter Alspach
Adrian If test[,2] is numeric then test[,2] <- -test[,2] should be all you need. If it isn't numeric you'll need to convert it first; e.g., test[,2] <- -as.numeric(as.character(test[,2])) which can, of course, be converted back to the original class. HTH ... Peter Alspach > -Origi

Re: [R] Question on spacing around plot and box in lattice

2008-04-03 Thread Deepayan Sarkar
On 4/3/08, Saptarshi Guha <[EMAIL PROTECTED]> wrote: > Hello, > How can i increase the padding between the axis and the data > region(box just containing the figure) in xyplot? > > An example: > new <- function(x){ if(x<0){ return(x^2) }else{ return(x) } } > x <- se

Re: [R] coding for categorical variables with unequal observations

2008-04-03 Thread Rolf Turner
On 4/04/2008, at 10:45 AM, Nordlund, Dan (DSHS/RDA) wrote: >> -Original Message- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf Of Tanya Yatsunenko >> Sent: Thursday, April 03, 2008 1:55 PM >> To: r-help@r-project.org >> Subject: [R] coding for categorical variables wit

Re: [R] coding for categorical variables with unequal observations

2008-04-03 Thread Nordlund, Dan (DSHS/RDA)
Ignore the previous post. I completely spaced out on which mailing list I was reading and thought this was a SAS question. My apologies, I'll just crawl back into my hole. :-) Obviously not helpful, Dan Daniel J. Nordlund Research and Data Analysis Washington State Department of Social and H

Re: [R] iterative loop with user input?

2008-04-03 Thread jim holtman
Is this what you want to do: > x.f <- function(){ + x <- list() + for (i in 1:10){ + z <- readline(paste("Parameter ", i, ": ", sep='')) + # just store the input in a list with the same key + x[[z]] <- z + } + x + } > x.f() Parameter 1: 12 Parameter 2: 2 Par

[R] convert data frame values

2008-04-03 Thread Adrian Johnson
Hello: How can I interchange symbols for numeric values in a data frame. > test f s t 1 a 1 -1 2 b 1 -3 3 c -1 1 say I have test d.f . I want to make flip number that are positive to negative and negative to positive only for numerics in column 's' my desired result: > new.test f s t

Re: [R] coding for categorical variables with unequal observations

2008-04-03 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Tanya Yatsunenko > Sent: Thursday, April 03, 2008 1:55 PM > To: r-help@r-project.org > Subject: [R] coding for categorical variables with unequal > observations > > Hi, > I am doing multiple regressio

[R] coding for categorical variables with unequal observations

2008-04-03 Thread Tanya Yatsunenko
Hi, I am doing multiple regression, and have several X variables that are categorical. I read that I can use dummy or contrast codes for that, but are there any special rules when there're unequal #observations in each groups (4 females vs 7 males in a "gender" variable)? Also, can R generate th

Re: [R] L-BFGS-B needs finite values of 'fn'

2008-04-03 Thread Paul Smith
Thanks, Ravi, for your insight. My initial experiments were conducted with b = 0.7, and my procedure (similar to yours) worked reasonably well. Then I wanted to check the quality of my procedure with lower b's, and the weak result motivated my initial post here. I have meanwhile got a reasonably a

Re: [R] bandwidth estimation using bw.SJ

2008-04-03 Thread D.Pleydell
Majnu John wrote: > > When I use bw.SJ (based on Sheather & Jones, 1991) in R to estimate > the bandwidth for a highly skewed data, I get the following message: > "sample is too sparse to find TD". I played around with the parameters > such as no. of bins (nb), lower, upper (range over which

Re: [R] What to do with this data?

2008-04-03 Thread Lucke, Joseph F
First compute side-by-side boxplots for the two data sets. You will see that the PG group has one (189), maybe 2 (also, 52) extreme values whereas the PG group has none. The PG group will have a smaller median than the PB group. Means, st devs, and se's are legitimate statistics but do not have

[R] iterative loop with user input?

2008-04-03 Thread Christopher Marcum
Hello R-Users, I would like to use an iterative loop to collect user input from within a function. I'm sure that this would be some combination of "for","break", and "next" but have not been able to get the syntax down. I would like to print some text to the screen at each step in the loop, ask t

Re: [R] Nonlinear equation

2008-04-03 Thread Berend Hasselman
Robert Mcfadden wrote: > > Dear R Users, > I'm trying to find function that allow me to solve one nonlinear equation. > Functions that I found are good for optimization problems. > > How about ?uniroot -- View this message in context: http://www.nabble.com/Nonlinear-equation-tp16452868p

[R] prettyR 25% quartile, 75% quartile

2008-04-03 Thread stephen sefick
I am using the describe function in prettyR. I would like to add the 25% 75% quartiles to the summary table how do I do this I have tried describe(x.f, num.desc=c("mean", "median", "sd", "min", "max", "skewness", "quantile(x.f, na.rm=T, probs=seq(0.25, 0.75))", "valid.n")) help -- Let's not

Re: [R] sqldf file specification, non-ASCII

2008-04-03 Thread Gabor Grothendieck
The Windows version is on sourceforge. On Thu, Apr 3, 2008 at 1:29 PM, Peter Jepsen <[EMAIL PROTECTED]> wrote: > Thank you for your help, Duncan and Gabor. Yes, I found an early line > feed in line 1562740, so I have corrected that error. The thing is, it > takes me many, many hours to save the fi

[R] What to do with this data?

2008-04-03 Thread mika03
Hello, This is not necessarily a question about R, but more about how we should display our data in general. (Will we then use R to do that, once we know what to do ;-) I received good replies about such things in the past on this mailing list so I give it a go. Here's what we did: We showed a

Re: [R] sqldf file specification, non-ASCII

2008-04-03 Thread Peter Jepsen
Thank you for your help, Duncan and Gabor. Yes, I found an early line feed in line 1562740, so I have corrected that error. The thing is, it takes me many, many hours to save the file, so I would like to confirm that there are no more errors further down the file. The ffe tool sounds like a perfect

Re: [R] R-help Digest, Vol 62, Issue 2

2008-04-03 Thread jarod_v6
Dear all. Thanks in advance for any help. I need to analisy a long list of data time/r\fluoscence I want to make one plot with standard deviation and the average data... Could you suggest me how to make that.. pippo.csv 0 0 4.013 62.96 6.053 112.3 24.14 106.2 ... _

[R] Question on spacing around plot and box in lattice

2008-04-03 Thread Saptarshi Guha
Hello, How can i increase the padding between the axis and the data region(box just containing the figure) in xyplot? An example: new <- function(x){ if(x<0){ return(x^2) }else{ return(x) } } x <- seq(-1,1,length.out=100) y <- sapply(x,new) sc=list

[R] Design package lrm summary and factors

2008-04-03 Thread sj
Hello, I have question regarding the lrm function and estimating the odds ratio between different levels of a factored variable. The following code example illustrates the problem I am having. I have a data set with an outcome variable (0,1) and an input variable (A,B,C). I would like to estimate t

Re: [R] help with R semantics

2008-04-03 Thread Ken Knoblauch
Hi, Charles Annis, P.E. StatisticalEngineering.com> writes: > logit.FC <- function(POD.floor = 0, POD.ceiling =1) > { if (POD.floor < 0 | POD.floor > 1) stop ("POD.floor must be between zero > and one.") > if (POD.ceiling < 0 | POD.ceiling > 1) stop ("POD.ceiling must be > between zero and

Re: [R] L-BFGS-B needs finite values of 'fn'

2008-04-03 Thread Ravi Varadhan
Paul, After looking at your objective function and the penalty, I realized that since the contribution of each term to the objective function decreases geometrically, the later terms contribute relatively less to the overall maximum. Hence the numerical estimation of those terms is much less prec

[R] help with R semantics

2008-04-03 Thread Charles Annis, P.E.
Greetings: I'm running R2.6.2 on a WinXP DELL box with 2 gig RAM. I have created a new glm link function to be used with family = binomial. The function works (although any suggested improvements would be welcome), logit.FC <- function(POD.floor = 0, POD.ceiling =1) { if (POD.floor <

Re: [R] sqldf file specification, non-ASCII

2008-04-03 Thread Duncan Murdoch
On 4/3/2008 10:22 AM, Peter Jepsen wrote: > Dear R-Listers, > > I am a Windows user (R 2.6.2) using the development version of sqldf to > try to read a 3GB file originally stored in .sas7bdat-format. I convert > it to comma-delimited ASCII format with StatTransfer before trying to > import just th

Re: [R] merge with rownames?

2008-04-03 Thread Chuck Cleland
On 4/3/2008 10:47 AM, Mark Kimpel wrote: > Can merge be tricked into merging via rownames as opposed to via contents of > a particular column? I have two data.frames with overlapping, but out of > order, rownames, but no column contents in common and would like to merge > without cbinding the rowna

[R] merge with rownames?

2008-04-03 Thread Mark Kimpel
Can merge be tricked into merging via rownames as opposed to via contents of a particular column? I have two data.frames with overlapping, but out of order, rownames, but no column contents in common and would like to merge without cbinding the rownames to the data.frames. Mark -- Mark W. Kimpel

[R] sqldf file specification, non-ASCII

2008-04-03 Thread Peter Jepsen
Dear R-Listers, I am a Windows user (R 2.6.2) using the development version of sqldf to try to read a 3GB file originally stored in .sas7bdat-format. I convert it to comma-delimited ASCII format with StatTransfer before trying to import just the rows I need into R. The problem is that I get this e

[R] getting serial anovas from a complex lm object obtained with a matrix of responses

2008-04-03 Thread Mark Kimpel
I have fit a model to ~20k different genes and would now like to extract the p-val for one of the effects, again for each individual gene. My model code is: mod <- lm(myResponseMatrix~ Time) Were I to do this with a response vector rather than matrix, the following would work: anovaResult<- anova

Re: [R] Overdispersion in count data

2008-04-03 Thread Wade Wall
Alright, I feel stupid now. That was the problem. For glm you can use both successes and failures, while with the negative binomial it is simply a count. That is why I was getting the subscript too long message. I understand generalized linear models, but I haven't worked with negative binomial

Re: [R] Overdispersion in count data

2008-04-03 Thread Gavin Simpson
On Thu, 2008-04-03 at 01:24 +, David Winsemius wrote: > "Wade Wall" <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > > Thanks for the recommendations, insights. I tried using glm.nb, but > > it didn't seem to like my data. I received the message (subscript) > > logical subscript t

Re: [R] Overdispersion in count data

2008-04-03 Thread Prof Brian Ripley
On Thu, 3 Apr 2008, Wade Wall wrote: > That is exactly how I am writing it. Glm works fine, but as I stated the > residual deviance is much greater (10x) than the degrees of freedom. I want > to take a look at using the negative binomial distribution, but I can't get > glm.nb to work. I get the

Re: [R] Overdispersion in count data

2008-04-03 Thread Michael Dewey
At 12:54 03/04/2008, Wade Wall wrote: >That is exactly how I am writing it. Glm works fine, but as I >stated the residual deviance is much greater (10x) than the degrees >of freedom. I want to take a look at using the negative binomial >distribution, but I can't get glm.nb to work. I get the m

Re: [R] Lapack error in Design:::ols

2008-04-03 Thread Prof Brian Ripley
This is not an LAPACK error, but an R function chol2inv complaining that it is being misused. The problem is that you have a vastly overparametrized model (using recover()) Browse[1]> dim(X) [1] 20 143 and ols() does not detect that, whereas lm() would. I'd suggest ols() is to blame here.

Re: [R] Overdispersion in count data

2008-04-03 Thread Wade Wall
That is exactly how I am writing it. Glm works fine, but as I stated the residual deviance is much greater (10x) than the degrees of freedom. I want to take a look at using the negative binomial distribution, but I can't get glm.nb to work. I get the message Error: (subscript) logical subscript t

Re: [R] why is text being rasterized with text()

2008-04-03 Thread Andrew Yee
Thank you for looking at my code. You are absolutely right. I'm mortified that I didn't see the text() tucked inside the for loop. Once I took it out of the loop, the text() works fine. Thanks, Andrew On Thu, Apr 3, 2008 at 1:52 AM, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > We haven't been

[R] Lapack error in Design:::ols

2008-04-03 Thread Gad Abraham
Hi, I'm trying to use Frank Harrell's Design:::ols function to do regression of y (numeric) on the interaction of two factors (x1 and x2), but Lapack throws an error: > library(Design) ... > load(url("http://www.csse.unimelb.edu.au/~gabraham/x";)) > ols(y ~ x1 * x2, data=x) Error in chol2inv

Re: [R] Overdispersion in count data

2008-04-03 Thread Michael Dewey
At 17:03 02/04/2008, Wade Wall wrote: >Hi all, > >I have count data (number of flowering individuals plus total number of >individuals) across 24 sites and 3 treatments (time since last burn). >Following recommendations in the R Book, I used a glm with the model y~ >burn, with y being two columns (

Re: [R] Thinking about using two y-scales on your plot?

2008-04-03 Thread Martin Rittner
Richie, A plot of the actual temperature during a year (or thousands of years, as people in palaeoclimate-studies are rather used to) is just so much more intuitive, than some correlation-coefficients or such. I know I'm largely speaking to statisticians in this forum, but in Earth Sciences, mo

[R] data.frame or list

2008-04-03 Thread baptiste AuguiƩ
Dear R list, I'm having difficulties in choosing between a list or a data.frame, or an array for the storage and manipulation of my data (example follows). I've been using the three for different purposes but I would rather like to know which is more adapted to what task. Here is the data I

[R] How to ask for *fixed* number of distributions under parameterized Gaussian mixture model.

2008-04-03 Thread Hung-Hsuan Chen (Sean)
Dear R users: I am wondering how to ask for *fixed* number of distributions under parameterized Gaussian mixture model. I know that em() and some related functions can predict the parameterized Gaussian mixture model. However, there seems no parameter to decide number of distributions to be mixed

Re: [R] Thinking about using two y-scales on your plot?

2008-04-03 Thread Richard Cotton
thegeologician wrote: > > ... very often time-series plots of some values are > given rather to show the temporal correlation of these, than to show the > actual numerical values! The same applies for plots of some sample > values over distance (eg. element concentration over a sample or >

[R] Reloading java classes with rJava

2008-04-03 Thread Gregory Jefferis
Dear R people, I have recently started using rJava to interact with Java code that I have written and am finding it a very useful bridge. Thanks! I have now run into a problem I can't figure out. If I edit and recompile my java source code I would like to force rJava to reload the modified java c

Re: [R] Thinking about using two y-scales on your plot?

2008-04-03 Thread Jim Lemon
Allen S. Rout wrote: > ... > I've got a series of graphs I generate in R to illustrate backup > activity. These are scaled, primarily, in bytes. But different > activities have different costs per byte, and I augment the bytes > scale with dollars. > > http://docs.osg.ufl.edu/tsm/current/ext/UFE

Re: [R] need help with understanding stepAIC

2008-04-03 Thread ONKELINX, Thierry
Dear Balavelan, First I would suggest to include the main effects of all variables in an interaction. So you model with interaction should be y ~ a + b + c + d + c:d. Which can be abbreviated to y ~ a + b + c*d. Futhermore you should take a look at ?predict.glm and pay attention to the newdata an