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

2012-10-21 Thread Jeff Newmiller
That is an intrinsic part of nonlinear optimization. Choose your starting point wisely. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.

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

2012-10-21 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] FreeBSD installation problems

2012-10-21 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

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

2012-10-21 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.1230414

[R] [newbie] failure to plot a RasterLayer with raster::plot or fields::image.plot

2012-10-21 Thread Tom Roche
summary: spatial data to be input to a regional-scale environmental model must (1) be converted to netCDF and then (2) regridded (cropped, projected, increased resolution). In a public git repository https://github.com/TomRoche/GEIA_to_NetCDF I have R code (with bash drivers) that does the

Re: [R] quantile regression using copulas

2012-10-21 Thread Marius Hofert
Please note: 1) your example is not working in the way you provided it (see http://www.minimalbeispiel.de/mini-en.html) 2) you receive a warning, not an error 3) I'd try and debug qua.regressCOP2 to see why the warning appears 4) in case 3) does not help, contact the maintainer of copBasic

Re: [R] Centering labels on X-axis

2012-10-21 Thread Jim Lemon
On 10/21/2012 09:03 AM, YAddo wrote: 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. Hi YAddo, This is another guess, that you have more ticks than labels because they

Re: [R] Help with programming a tricky algorithm

2012-10-21 Thread Rui Barradas
Hello, The function in my previous post gives neighbours in north, south, east and west but also the corners, for a total of 8, not 4, neighbours. Corrected: is.border - function(idx, DF){ i1 - DF$ix %in% DF$ix[idx] + c(-1, 1) DF$iy == DF$iy[idx] i2 - DF$iy %in% DF$iy[idx] + c(-1,

Re: [R] Which package/function for solving weighted linear least squares with inequality and equality constraints?

2012-10-21 Thread Thomas Schu
Dear Berend, Thank you very much for proposing the limSolve-package! The lsei function of the package is exactly what I was looking for. Best regards Thomas -- View this message in context:

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

2012-10-21 Thread Thomas Schu
Dear Richard, It is funny. I have to perform the approach of sediment fingerprinting for my master thesis. Mr. Hasselman gave me the advice to take a closer look into the limSolve package a few days ago. http://cran.r-project.org/web/packages/limSolve/index.html I guess, the lsei-function of

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

2012-10-21 Thread Berend Hasselman
On 21-10-2012, at 13:37, Thomas Schu wrote: Dear Richard, It is funny. I have to perform the approach of sediment fingerprinting for my master thesis. Mr. Hasselman gave me the advice to take a closer look into the limSolve package a few days ago.

Re: [R] R Package for Longitudinal Binary Response Data?

2012-10-21 Thread Frank Harrell
I didn't get any responses to this question so just trying one more time ... -Frank Frank Harrell wrote The bild package appears to be an excellent package for serial binary responses. But it is for discrete time. I would like to specify a smooth function of time for the odds ratio

[R] Linear discriminant function analysis based median as group centroid and nonparametric scale estimators???

2012-10-21 Thread Thomas Schu
Dear All, I am using a specific approach for my master thesis. In essence, a supervised reclassification is used as an intermediate step to find chemical parameters which are able to reclassify defined groups. These variables will be used in a next step where location and scale estimators of the

Re: [R] Help with programming a tricky algorithm

2012-10-21 Thread arun
HI, I am not sure whether this is what you want. Mydata-read.table(text=  idxy    ix    iy    country    col5  1    1    1    c1    x1  2    1    2    c1    x2   3    1    3    c1    x3    4    2    4    c1    x4  5    2    4    c2   

Re: [R] quantile regression using copulas

2012-10-21 Thread indus
Hi Marius, I have tried debugging the qua.regressCOP2 function. The error I'am getting is: Error in cop(u, v + delv, ...) : unused argument(s) (v + delv). Unable to decipher it. And have mailed to william.asquith at ttu.edu. Thanks indu -- View this message in context:

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

2012-10-21 Thread Richard James
Dear Berend, Many thanks for taking your time to assist with this optimization problem. I'll work on data this week and let you know how I get on. Again, many thanks Richard -- View this message in context:

Re: [R] dynamic panel data estimation

2012-10-21 Thread mabonazel
yes, can you use the (plm) package for panel data estimation in general but, i not know a package for dynamic panel data models -- View this message in context: http://r.789695.n4.nabble.com/R-Comparing-posterior-and-likelihood-estimates-for-proportions-off-topic-tp814022p4646910.html Sent

Re: [R] Labelling individual points on 3D PCA scatterplot

2012-10-21 Thread Wang Ran
Hello,I am a Chinese student, and I got the same problem. I have learnd R for several weeks, I want to draw a PCA picture. I have data in excel format like this: ID d1 d2 d3 d4 A 1234 B 1234 C 1234 D 1234 E 1234 How to load these

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

2012-10-21 Thread stats12
You are right. I ran the code again and got the same error again. But ran it for the second time, it didn't return an error and I got some values. It's my first time doing this kind of coding and I'm still learning. I agree that my code may look unorganized and wrong. I'll work on your comments

[R] [Vars] package: impulse response function

2012-10-21 Thread Maria Grigoryeva
Hello, I'm doing a research on the impulse responses in VAR models and I'm having troubles in interpretation of R results. My question is what is the shock of impulse variable that is produced to obtain the response? Is it one-standard-deviation positive shock? If it is so how can I obtain the

[R] Changing a for loop to a function using sapply

2012-10-21 Thread Ed
Apparently there is one or more concepts that I do not fully understand from the descriptions of a function and the apply material. I have been reading the mail from this forum and have learned much but, in this case, what I have been reading here and from the manual isn't enough. The

Re: [R] Help with programming a tricky algorithm

2012-10-21 Thread Rui Barradas
Hello, Thanks for the dataset, Arun, I could test my function and it was still wrong (apologies to the op). Now I think I've got it. is.border - function(idx, DF){ i1 - DF$ix %in% (DF$ix[idx] + c(-1, 1)) DF$iy == DF$iy[idx] i2 - DF$iy %in% (DF$iy[idx] + c(-1, 1)) DF$ix == DF$ix[idx]

[R] Navigating a grid.

2012-10-21 Thread Michael Muratet
Greetings I am trying to make a multiple panel plot from a tool (genoPlotR) that is layered on grid. My code and session info are below. When I execute the code, I get a single plot in the center of the graphics page. I have tried various pop/push/down/seekViewport commands at the end of

[R] longitudinal data

2012-10-21 Thread asma boshaala
 I would like to use GLM to analysis  a longitudinal data  any one know which library in R do so thanks alot [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] help speeding up simple Theil regression function

2012-10-21 Thread Brad Schneid
Hello, I am working on a simple non-parametric (Theil) regression function and and am following Hollander and Wolfe 1999 text. I would like some help making my function faster. I have compared with pre-packaged version from MBLM, which isnt very fast either, but it appears mine is faster with N

Re: [R] help speeding up simple Theil regression function

2012-10-21 Thread Brad Schneid
Obviously sort() is not needed in the following line: X - median( sort( do.call(c, num) / do.call(c, dom) ) ) Brad Schneid wrote Hello, I am working on a simple non-parametric (Theil) regression function and and am following Hollander and Wolfe 1999 text. I would like some help

Re: [R] MLE of negative binomial distribution parameters

2012-10-21 Thread Zoraida
Thank you!!! -- View this message in context: http://r.789695.n4.nabble.com/MLE-of-negative-binomial-distribution-parameters-tp4646703p4646927.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] help speeding up simple Theil regression function

2012-10-21 Thread Berend Hasselman
On 21-10-2012, at 20:06, Brad Schneid wrote: Hello, I am working on a simple non-parametric (Theil) regression function and and am following Hollander and Wolfe 1999 text. I would like some help making my function faster. I have compared with pre-packaged version from MBLM, which isnt

Re: [R] help speeding up simple Theil regression function

2012-10-21 Thread Brad Schneid
Wow. Thank you greatly, that is amazing. Thiel statistic == (Pedantic comment: it is Theil (swap the i and e) Yes sir; I do that every time. Dyslexia perhaps? Thanks again. Berend Hasselman wrote On 21-10-2012, at 20:06, Brad Schneid wrote: Hello, I am working on a simple

Re: [R] help speeding up simple Theil regression function

2012-10-21 Thread William Dunlap
My comments have nothing to do with speed of your code, but with the correctness. np.lm -function(dat, X, Y, ...){ # Ch 9.2: Slope est. (X) for Thiel statistic ... num[[i]] - dat[j.s[i],Y] - dat[i.s[i],Y] dom[[i]] - dat[j.s[i],X] -

Re: [R] help speeding up simple Theil regression function

2012-10-21 Thread Brad Schneid
I understand, thank you. I think I wanted the output to look similar to that from mblm for quick comparison; that is obviously a problem. William Dunlap wrote My comments have nothing to do with speed of your code, but with the correctness. np.lm -function(dat, X, Y, ...){ # Ch

[R] DLM package + State Space

2012-10-21 Thread nserdar
I plan to estimate the multi-factor model for Kalman Filter Mean Reverting, Random Coefficient. For example: R(it)= Alpha(it)+ Beta(it)R(mt)+Gamma(it)(R(mt)^2)+delta(it)(R(mt)^3)+ V(it) Note: (alphabar= Mean Alpha, Betabar= Mean Beta, Gamma= Mean Gamma, Deltabar= Delta Mean) KF Mean

[R] Help me please to code....

2012-10-21 Thread Rlotus
User has to type (input) x. After inputcode has to check X with statement if There is a statement IF. If X=0 then Y=5/2 else =7; How to code it please. I tried but my code does not work ;( I wanna see how it looks like( thank u in advance( -- View this message in context:

Re: [R] [Vars] package: impulse response function

2012-10-21 Thread Jeff Newmiller
Read the posting guide. We have no way to know what you are doing unless you show the list readers with sample data and code. If you are wondering about Vector Autoregressive models, I don't claim any specific experience with them, but [1] says they are linear, and I do know that linear models

[R] R^2 in Poisson via pr2() function: skeptical about r^2 results

2012-10-21 Thread Eiko Fried
Hello. I am running 9 poisson regressions with 5 predictors each, using glm with family=gaussian. Gaussian distribution fits better than linear regression on fit indices, and also for theoretical reasons (e.g. the dependent variables are counts, and the distribution is highly positively skewed).

Re: [R] Changing a for loop to a function using sapply

2012-10-21 Thread Rui Barradas
Hello, You're right an _explicit_ for loop is not necessary in your case, but note that the *apply functions are just for loops in disguise. They are also the prefered R idiom. In this case I've used ?replicate, a function of the *apply family. To be more readable it uses a new function,

Re: [R] Help me please to code....

2012-10-21 Thread Rui Barradas
Hello, First of all, you should _really_ try to read An Introduction to R, file R-intro.pdf that comes with every installation of R. The answer to your question is in chapter 9 Grouping, loops and conditional execution. It's the very first example: 9.2.1 Conditional execution: if statements

Re: [R] Changing a for loop to a function using sapply

2012-10-21 Thread arun
Hi, With sapply(): fun3-function(n){  paste(t(sapply(random.string(n),randomizeString)),collapse=)  }  DNA3-replicate(20,fun(21))  DNA3  #[1] cttgcaatgtttaatcgttggagcagt  #[2] tgcgttatcgcgcagagggccgtgagggat   #[3]

Re: [R] system.time question

2012-10-21 Thread William Dunlap
Others have said what system time is, time spent in the kernel of the operating system doing things on behalf of your program. Also, switching between user and system mode can be time consuming, so the number of system calls can be important, even if each one takes little time. I don't know how

Re: [R] Help me please to code....

2012-10-21 Thread arun
HI, Try this: fun1-function(X){  Y-ifelse(X==0,5/2,7)  return(Y)}  fun1(5) #[1] 7  fun1(0) #[1] 2.5  fun1(2) #[1] 7 A.K. - Original Message - From: Rlotus yerl...@hotmail.com To: r-help@r-project.org Cc: Sent: Sunday, October 21, 2012 3:03 PM Subject: [R] Help me please to code

[R] Parameter Matrix

2012-10-21 Thread Simeon Lisovski
Hallo, I would like to run a model (differential equations) with a whole bunch of parameter combinations. I think the best way of doing this is to put the model function into a loop and set a matrix with the parameters: Each row will represent the parameters for one loop. I know how to compile

[R] conditional value assignment

2012-10-21 Thread penguins
Hi, I am trying to assign values to records based conditionally on other records within a dataframe. For example, in the following dataframe the NA value in dat$age would be replaced if the age status for that individual and specific year can be found in another record. Ideally this would then

[R] glm.nb - theta, dispersion, and errors

2012-10-21 Thread Eiko Fried
I am running 9 negative binomial regressions with count data. The nine models use 9 different dependent variables - items of a clinical screening instrument - and use the same set of 5 predictors. Goal is to find out whether these predictors have differential effects on the items. Due to various

Re: [R] Parameter Matrix

2012-10-21 Thread arun
Hi, Try this: new1-as.data.frame(expand.grid(a=a,b=b,c=c))  mat1-as.matrix(new1[order(new1$a),])  row.names(mat1)-1:nrow(mat1) mat1 #  a b c #1 1 5 1 #2 1 5 6 #3 2 5 1 #4 2 5 6 A.K. - Original Message - From: Simeon Lisovski simeon.lisov...@me.com To: r-help@r-project.org Cc: Sent:

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

2012-10-21 Thread Frank Harrell
Stephanie, I'm working on an option for the plot method for Predict that will allow you to do this. Note that this approach will not result in very readable predictor category labels when they are long character strings. If you are using linux I can get you a new version of rms with this option

[R] random forest

2012-10-21 Thread Gyanendra Pokharel
Hi all, Can some one tell me the difference between the following two formulas? 1. epiG.rf -randomForest(gamma~.,data=data, na.action = na.fail,ntree = 300,xtest = NULL, ytest = NULL,replace = T, proximity =F) 2.epiG.rf -randomForest(gamma~.,data=data, na.action = na.fail,ntree = 300,xtest =

Re: [R] random forest

2012-10-21 Thread Gyanendra Pokharel
Sorry, the previous was not right post. I want to know the difference between following to methods of random forest. 1. epiG.rf -randomForest(gamma~.,data=data, na.action = na.fail,ntree = 300,xtest = NULL, ytest = NULL,replace = T, proximity =F) 2. epiG.rf -randomForest(x = data,,y =

Re: [R] [newbie] failure to plot a RasterLayer with raster::plot or fields::image.plot

2012-10-21 Thread Tom Roche
https://stat.ethz.ch/pipermail/r-help/2012-October/326837.html summary: spatial data to be input to a regional-scale environmental model must (1) be converted to netCDF and then (2) regridded (cropped, projected, increased resolution). In a public git repository

Re: [R] conditional value assignment

2012-10-21 Thread Rui Barradas
Hello, First of all, two notes on the way you create your data.frame 1. Use age - c(Adult, NA, ...etc...) _without_ quotes around NA. If you use quotes it will seen as a character, not as the value NA. 2. Do not cbind and then coerce to data.frame, use data.frame only. So the data and an