Re: [R] Error in integrate(integrand, 0, Inf) : non-finite function value

2012-10-20 Thread Berend Hasselman
On 21-10-2012, at 05:01, stats12 wrote: > Hi, > > Thank you for your comment. I worked on the code again and was able to make > it work. The only problem I am having right now is that nlm depends on the > initial value. > > When the initial value is 1, I get the following estimates > 0.123041

Re: [R] FreeBSD installation problems

2012-10-20 Thread Rainer Hurling
On 21.10.2012 02:47 (UTC+2), J. Maxwell wrote: > R Compiliing or installation failure on FreeBSD > 9.0-RELEASE FreeBSD ; I386 box. > > configuring with the default settings, no 'options' => > > ./configure Is there any reason that you are not using the FreeBSD ports system, in this case /usr/por

Re: [R] Error in integrate(integrand, 0, Inf) : non-finite function value

2012-10-20 Thread David Winsemius
On Oct 20, 2012, at 8:01 PM, stats12 wrote: > Hi, > > Thank you for your comment. I worked on the code again and was able to make > it work. Does that mean you know what value is "correct" for certain cases? Is there an overall strategy that is guiding this effort? I wrote earlier: > DW> Your

Re: [R] Error in integrate(integrand, 0, Inf) : non-finite function value

2012-10-20 Thread Jeff Newmiller
That is an intrinsic part of nonlinear optimization. Choose your starting point wisely. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

Re: [R] Error in integrate(integrand, 0, Inf) : non-finite function value

2012-10-20 Thread stats12
Hi, Thank you for your comment. I worked on the code again and was able to make it work. The only problem I am having right now is that nlm depends on the initial value. When the initial value is 1, I get the following estimates 0.1230414 19.6271029 when it is 2, I get the following 29.46874 2

Re: [R] Centering labels on X-axis

2012-10-20 Thread David Winsemius
On Oct 20, 2012, at 3:03 PM, YAddo wrote: > Thanks Jim and Rui. > > My apologies, i did not give enough info on my plot. Nor do you even now. Offer a data example. > > I am using : plot(x,y) for a line plot. I want to center the labels on the > x-axis for each tick. Code. We want code. -

[R] FreeBSD installation problems

2012-10-20 Thread J. Maxwell
R Compiliing or installation failure on FreeBSD 9.0-RELEASE FreeBSD ; I386 box. configuring with the default settings, no 'options' => ./configure ... ... ... checking whether gcc -std=gnu99 supports -c -o FILE.lo... yes checking for gcc -std=gnu99 option to support OpenMP..

[R] rms plot.Predict question: swapping x- and y- axis for categorical predictors

2012-10-20 Thread stephsus
Hello all, I'm trying to plot the effects of variables estimated by a regression model fit individually, and for categorical predictors, the independent variable shows up on the y-axis, with the dependent variable on the x-axis. Is there a way to prevent this reversal? Sample code with dummy data

Re: [R] Centering labels on X-axis

2012-10-20 Thread YAddo
Thanks Jim and Rui. My apologies, i did not give enough info on my plot. I am using : plot(x,y) for a line plot. I want to center the labels on the x-axis for each tick. Thanks. -- View this message in context: http://r.789695.n4.nabble.com/Centering-labels-on-X-axis-tp4646761p4646888.ht

Re: [R] Logistic regression/Cut point? predict ??

2012-10-20 Thread Simon Knapp
What do you mean by "at x equal zero"? On Sun, Oct 21, 2012 at 8:37 AM, Adel Powell wrote: > I am new to R and I am trying to do a monte carlo simulation where I > generate data and interject error then test various cut points; however, my > output was garbage (at x equal zero, I did not get .50)

Re: [R] Expected number of events, Andersen-Gill model fit via coxph in package survival

2012-10-20 Thread Omar De la Cruz C.
I have a follow-up question (for either Dr. Therneau, or anybody who might know). sum(zz) (see below) estimates the number of events for the cohort. Now, how can I compute a confidence interval for sum(zz)? Or a standard error? My obvious choice, square root of the sum of the squares of the stand

[R] Credit Scoring in R - Weight of Evidence

2012-10-20 Thread Axel Urbiz
Dear List, I couldn't find any package that performs the "weight of evidence" of predictors (a transformation usually performed in credit scoring applications). Is there any that you know? Thanks, Axel. [[alternative HTML version deleted]] __

[R] Logistic regression/Cut point? predict ??

2012-10-20 Thread Adel Powell
I am new to R and I am trying to do a monte carlo simulation where I generate data and interject error then test various cut points; however, my output was garbage (at x equal zero, I did not get .50) I am basically testing the performance of classifiers. Here is the code: n <- 1000; # Sample size

Re: [R] Error in integrate(integrand, 0, Inf) : non-finite function value

2012-10-20 Thread David Winsemius
On Oct 20, 2012, at 9:23 AM, stats12 wrote: > Dear R users, > > When I run the code below, I get the error "Error in integrate(integrand, 0, > Inf) : non-finite function value". The code works if the function returns > only "sum(integ)". But you never showed us the working code. > However, I

Re: [R] se's and CI's for fitted lines in multivariate regression analysis

2012-10-20 Thread David Winsemius
On Oct 16, 2012, at 11:58 AM, Sigrid wrote: > Okay, I've now tried to the predict function and get the SE, although it seem > to calculate SE for each observation from the line (I assume), while I want > the CI-interval and SE for each line fitted line for the treatment. I do not > really underst

Re: [R] Trouble returning 2D array into R from Fortran

2012-10-20 Thread Berend Hasselman
Look at my comments in between your post. On 20-10-2012, at 19:18, paulfjbrowne wrote: > I will look into using inline, but since the Fortran code is several thousand > lines long & is comprised of multiple subroutines, compiling it into a > shared object & dynamically loading it into R is prob

[R] [R-pkgs] ggmcmc 0.2 has been released

2012-10-20 Thread Xavier Fernández i Marín
Dear all, ggmcmc-0.2 has been released. ggmcmc is a tool for assessing and diagnosing convergence of Markov Chain Monte Carlo simulations, as well as for graphically display results from full MCMC analysis. The package also facilitates the graphical interpretation of models by providing flexible

Re: [R] Trouble returning 2D array into R from Fortran

2012-10-20 Thread paulfjbrowne
I will look into using inline, but since the Fortran code is several thousand lines long & is comprised of multiple subroutines, compiling it into a shared object & dynamically loading it into R is probably the easier solution. I have also noticed a strange numerical problem when calling the routi

Re: [R] Creating a new by variable in a dataframe

2012-10-20 Thread arun
HI Bill, I figured it out.  d$flag2<-unlist(lapply(unname(split(d[[3]],d$date)),function(x) x==max(x))) # [1] FALSE FALSE FALSE  TRUE  TRUE FALSE FALSE FALSE FALSE  TRUE ")" created the error. A.K. - Original Message - From: William Dunlap To: arun ; Flavio Barros Cc: R help ; ramo

Re: [R] Creating a new by variable in a dataframe

2012-10-20 Thread arun
HI Bill, Thanks for the reply. It was unnecessarily complicated. d$flag<-unlist(lapply(split(d,d$date),function(x) x[3]==max(x[3])),use.names=FALSE) #or d$flag<-unlist(lapply(split(d,d$date),function(x) x[3]==max(x[3]))) should have done the same job. str(d) #'data.frame':    10 obs. of  4 variab

Re: [R] se's and CI's for fitted lines in multivariate regression analysis

2012-10-20 Thread Sigrid
Hi again, Thank you so much for the script. Unfortunately, I feel like I might not have explained things clearly enough from the start. What I’m looking for is the st. errors or CI intervals for the estimate the parameter for slope and intercept for each level of each factor. From the summary tab

Re: [R] saving to docx

2012-10-20 Thread Duncan Temple Lang
Just to let people know On the Omegahat site (and source on github), there are packages for working with Office Open documents (and LibreOffice too), includinging RWordXML, RExcelXML and the generic package OOXML on which they rely. These are prototypes in the sense that they do not comprehe

[R] Error in integrate(integrand, 0, Inf) : non-finite function value

2012-10-20 Thread stats12
Dear R users, When I run the code below, I get the error "Error in integrate(integrand, 0, Inf) : non-finite function value". The code works if the function returns only "sum(integ)". However, I want to add "cmh" to it. When I add "cmh" I get that error. I can't figure out why this is happening b

Re: [R] Creating a new by variable in a dataframe

2012-10-20 Thread William Dunlap
> d$flag2 <- unlist(lapply(unname(split(d[[3]], d$date), function(x)x==max(x I'm sorry, I stuck in the unname() in the mail but did not run it - its closing parenthesis should be after split's closing parenthisis, not at the end. > d$flag2 <- unlist(lapply(unname(split(d[[3]], d$date)), functi

Re: [R] mark sections on a time chart

2012-10-20 Thread Christof Kluß
Hello Rui Barradas thank you very much. That is exactly what I was looking for. Christof Am 20-10-2012 14:19, schrieb Rui Barradas: > library(zoo) > > arrowsRange <- function(from, to, at = 1, labels = NULL, > length = 1/8, horizontal = TRUE, border = FALSE, ...){ > require(plotrix) >

Re: [R] system.time question

2012-10-20 Thread Prof Brian Ripley
On 20/10/2012 17:16, Mark Leeds wrote: Hi : I looked at the help for system.time but I still have the following question. Can someone explain the output following output of system.time : user system elapsed 12399.681 5632.352 56935.647 Yes, the help page can, via ?proc.time.

Re: [R] system.time question

2012-10-20 Thread Jeff Newmiller
You asked several questions. Elapsed: yes User + System = CPU: yes Finally: You have to look at the load and/or cpu core count. Unless you setup your code to take advantage of multiple cores, R runs on a single core. Also: Do you really need to ask that question? -

Re: [R] Trouble returning 2D array into R from Fortran

2012-10-20 Thread Berend Hasselman
See inline. On 20-10-2012, at 17:18, paulfjbrowne wrote: > Hello, > > I have been trying to use a collection of Fortran subroutines to return a 2D > array of calculated values to my R code, calling a Fortran wrapper > subroutine from R. I've done this successfully before with C & C++ code. >

[R] system.time question

2012-10-20 Thread Mark Leeds
Hi : I looked at the help for system.time but I still have the following question. Can someone explain the output following output of system.time : user system elapsed 12399.681 5632.352 56935.647 Here's my take based on the fact that I was doing ps -aux | grep R off and on and

Re: [R] Creating a new by variable in a dataframe

2012-10-20 Thread William Dunlap
> d$flag<-unlist(rbind(lapply(split(d,d$date),function(x) x[3]==max(x[3] I think that line is unnecessarily complicated. lapply() returns a list and rbind applied to one argument, L, mainly adds dimensions c(length(L),1) to it (it also changes its names to rownames). unlist doesn't care about

Re: [R] dotchart ordering problem

2012-10-20 Thread Zenonn87
I've got another problem. What if I have another dotchart with same categories, but one of the data are missing (control A)?? So I want to leave out from the dotchart. In this case in the control category should have only one dotline, because the other one is empty. Or mark somehow that it's missi

[R] Trouble returning 2D array into R from Fortran

2012-10-20 Thread paulfjbrowne
Hello, I have been trying to use a collection of Fortran subroutines to return a 2D array of calculated values to my R code, calling a Fortran wrapper subroutine from R. I've done this successfully before with C & C++ code. The Fortran wrapper subroutine which is to be called by R takes a set of

Re: [R] Can I please be taken off the mailing list

2012-10-20 Thread David Winsemius
On Oct 20, 2012, at 7:50 AM, Jonathan Brown wrote: > > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list The link below is where you most likely subscribed and where you also need to go to unsubscribe. None of

[R] Can I please be taken off the mailing list

2012-10-20 Thread Jonathan Brown
[[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained,

Re: [R] R2OpenBUGS quesion

2012-10-20 Thread charlie
Received the same error with OpenBUGS322 trying to run the schools example under Wine 1.5.15, R 2.15.1, R2OpenBUGS_3.2-1.4, on a mac pro with Snow Leopard . I then tried with OpenBUGS321 and it ran fine. -- View this message in context: http://r.789695.n4.nabble.com/R2OpenBUGS-quesion-tp46

Re: [R] fit a "threshold" function with nls

2012-10-20 Thread Bert Gunter
Inline. -- Bert On Sat, Oct 20, 2012 at 6:44 AM, Véronique Boucher Lalonde wrote: > Thank you all for your help. I think I now understand the issue. > I tried to write a likelihood function for my binomial model. > Please excuse my ignorance if I am not doing this right; I do not have any > stat

Re: [R] supply methods to read.table

2012-10-20 Thread Ben Bolker
Brian gmail.com> writes: > > Hi List, > > I would like to optimize some data reading as well as clean up some > code. The manual tells me to supply methods to colClasses but the manual > and the methods documentation aren't helping... > Can someone provide me an example please? > Your pos

Re: [R] MLE of negative binomial distribution parameters

2012-10-20 Thread Ben Bolker
Zoraida ingellicom.com> writes: > > I need to estimate the parameters for negative binomial distribution (pdf) > using maximun likelihood, I also need to estimate the parameter for the > Poisson by ML, which can be done by hand, but later I need to conduct a > likelihood ratio test between these

Re: [R] fit a "threshold" function with nls

2012-10-20 Thread Véronique Boucher Lalonde
Thank you all for your help. I think I now understand the issue. I tried to write a likelihood function for my binomial model. Please excuse my ignorance if I am not doing this right; I do not have any statistical background. #Example data x <- seq(0, 1000) y <- ifelse(x < 300, 0, ifelse(x>700, 0,

Re: [R] mark sections on a time chart

2012-10-20 Thread Rui Barradas
Hello, Sorry, didn't paste the function call. plot(z) abline(v = c(start[1], end)) arrowsRange(start, end, at = 0, labels = seasons) Rui Barradas Em 20-10-2012 13:19, Rui Barradas escreveu: Hello, The function below requires package plotrix and is far from fully tested, but it might do wha

Re: [R] Error: not 'a real'?

2012-10-20 Thread Brian
Hi Milan, that's right, forgot about that one! Sorry to bother. Brian On 10/20/12 14:37, Milan Bouchet-Valat wrote: Le samedi 20 octobre 2012 à 14:25 +0200, Brian a écrit : Hi Jim, On 10/20/12 13:36, Jim Holtman wrote: how about supplying the context of the error. Show the lines in the file

Re: [R] Error: not 'a real'?

2012-10-20 Thread Milan Bouchet-Valat
Le samedi 20 octobre 2012 à 14:25 +0200, Brian a écrit : > Hi Jim, > > On 10/20/12 13:36, Jim Holtman wrote: > > how about supplying the context of the error. Show the lines in the file > > where the error occurred. > > > > Sent from my iPad > > > > On Oct 20, 2012, at 7:21, Brian wrote: >

Re: [R] Error: not 'a real'?

2012-10-20 Thread Brian
Hi Jim, On 10/20/12 13:36, Jim Holtman wrote: how about supplying the context of the error. Show the lines in the file where the error occurred. > > Sent from my iPad > > On Oct 20, 2012, at 7:21, Brian wrote: > >> Hi List, >> >> when supplying a vector of atomic vector classes to read.table

Re: [R] mark sections on a time chart

2012-10-20 Thread Rui Barradas
Hello, The function below requires package plotrix and is far from fully tested, but it might do what you want. library(zoo) arrowsRange <- function(from, to, at = 1, labels = NULL, length = 1/8, horizontal = TRUE, border = FALSE, ...){ require(plotrix) f1 <- function(){

Re: [R] can't find the error in if function... maybe i'm blind?

2012-10-20 Thread Milan Bouchet-Valat
Le samedi 20 octobre 2012 à 03:27 -0700, Janosch a écrit : > Hi everybody, > > the following alway gives me the error > "Fehler in if (File$X.Frame.Number[a] + 1 == File$X.Frame.Number[a + 1]) > (File$FishNr[a] <- File$FishNr[a - : Fehlender Wert, wo TRUE/FALSE nötig > ist". Maybe its stupid,

Re: [R] can't find the error in if function... maybe i'm blind?

2012-10-20 Thread Jim Holtman
Learn how to debug your programs. Start with options(error = recover) this will give you control at the point of the error so you can examine values. Most likely one of the variables in the 'if' expression is an NA. Sent from my iPad On Oct 20, 2012, at 6:27, Janosch wrote: > Hi everybody,

Re: [R] Error: not 'a real'?

2012-10-20 Thread Jim Holtman
how about supplying the context of the error. Show the lines in the file where the error occurred. Sent from my iPad On Oct 20, 2012, at 7:21, Brian wrote: > Hi List, > > when supplying a vector of atomic vector classes to read.table, I get: > # column classes > colClasses=c("character", "

[R] supply methods to read.table

2012-10-20 Thread Brian
Hi List, I would like to optimize some data reading as well as clean up some code. The manual tells me to supply methods to colClasses but the manual and the methods documentation aren't helping... Can someone provide me an example please? Best, Brian R version 2.15.1 (2012-06-22) Platform:

[R] Error: not 'a real'?

2012-10-20 Thread Brian
Hi List, when supplying a vector of atomic vector classes to read.table, I get: # column classes colClasses=c("character", "character","numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric") # Err

[R] can't find the error in if function... maybe i'm blind?

2012-10-20 Thread Janosch
Hi everybody, the following alway gives me the error "Fehler in if (File$X.Frame.Number[a] + 1 == File$X.Frame.Number[a + 1]) (File$FishNr[a] <- File$FishNr[a - : Fehlender Wert, wo TRUE/FALSE nötig ist". Maybe its stupid, but i'm not getting why... Maybe someone can help me. Thanks a lot! f

Re: [R] Help with programming a tricky algorithm

2012-10-20 Thread Rui Barradas
Hello, You should post a data example with ?dput. If your dataset is named MyData, use dput( head(MyData, 30) ) # paste the output of this in a post Anyway, I believe the following function might do what you want. It's untested, though. (Your example dataset is usefull but could be better)

Re: [R] Optimization in R similar to MS Excel Solver

2012-10-20 Thread Berend Hasselman
I do not know what algorithms the Excel solver function uses. See inline for how to do what you want in R. Forgive me if I have misinterpreted your request. On 19-10-2012, at 16:25, Richard James wrote: > Dear Colleagues, > I am attempting to develop an optimization routine for a river suspende

Re: [R] how can I make a legend that applies for all the barplots in one same page?

2012-10-20 Thread Prof Brian Ripley
On 20/10/2012 10:33, Jim Lemon wrote: On 10/20/2012 06:22 AM, Yakamu Yakamu wrote: Dear all, I would like to make 6 barplots in one page but with a legend that applies to all the barplots and would like to put it in the central-bottom of the page. I know only how to make legend for individual b

Re: [R] how can I make a legend that applies for all the barplots in one same page?

2012-10-20 Thread Jim Lemon
On 10/20/2012 06:22 AM, Yakamu Yakamu wrote: Dear all, I would like to make 6 barplots in one page but with a legend that applies to all the barplots and would like to put it in the central-bottom of the page. I know only how to make legend for individual barplot, but since all my barplots hav

Re: [R] Axis Breaks with ggplot2

2012-10-20 Thread Jim Lemon
On 10/20/2012 01:50 AM, Edward Patzelt wrote: R-help - I'm trying to create axis breaks similar to this : http://www.r-bloggers.com/wp-content/uploads/2010/08/bar-chart-natural-axis-split1.png . Hi Edward, The gap.barplot function in the plotrix package does something like this, but it is not

Re: [R] Centering labels on X-axis

2012-10-20 Thread Jim Lemon
On 10/20/2012 01:39 AM, YAddo wrote: Dear all: I am trying to center labels on my plot with not much success. I have tried text(), mtext() but it's not working. I think I am using the wrong function for my task. Any help will be appreciated. My working codes. axis(1, at=c(1,2,3,4,5),font.lab

[R] Help with programming a tricky algorithm

2012-10-20 Thread Andrew Crane-Droesch
Hi All, I'm a little stumped by the following problem. I've got a dataset with the following structure: idxyixiycountry(other variables) 111c1x1 212c1x2 313c1x3 ... .