[R] Environmental problems.

2014-02-25 Thread Rolf Turner
I have a function that makes use of the ode() function from the deSolve package. I am trying to find a way of getting it to put out a progress report every t.int time units (by progress report I just mean reporting what time it's got up to). I thought to put code something like the

Re: [R] fitting a time series into a GARCH model using fGarch

2014-02-25 Thread Kehl Dániel
Dear Charles, see the help file and the examples at http://cran.r-project.org/web/packages/fGarch/fGarch.pdf or use ?garchFit in the examples you will see for example: garchFit(~ garch(1,1), data = x.vec, trace = FALSE) Try something like that. Make sure you provide the package of the function

[R] combine 2 data.frames in dependence of the ID

2014-02-25 Thread Mat
Hello together, i have a little problem, maybe anyone can help me. I have 2 data.frame, one look like this one: FS_ID ABNR 9327 33688812 11391 33688812 11392 33688812 11388 33688812 11390 33688812 12028 33688812 12029 33688812 the other data.frame looks like as follows:

Re: [R] Environmental problems.

2014-02-25 Thread Enrico Schumann
On Tue, 25 Feb 2014, Rolf Turner r.tur...@auckland.ac.nz writes: I have a function that makes use of the ode() function from the deSolve package. I am trying to find a way of getting it to put out a progress report every t.int time units (by progress report I just mean reporting what time

Re: [R] Environmental problems.

2014-02-25 Thread Duncan Murdoch
On 14-02-25 3:08 AM, Rolf Turner wrote: I have a function that makes use of the ode() function from the deSolve package. I am trying to find a way of getting it to put out a progress report every t.int time units (by progress report I just mean reporting what time it's got up to). I thought

[R] GLM with Numeric and Factor as an Input

2014-02-25 Thread Lorenzo Isella
Dear All, Please consider the snippet at the end of the email. It is representative of the problems I am experiencing. I am trying to use glm (without using the formula interface because the original data is quite large) to model the response in a case where the predictors are a mix of

Re: [R] shapiro.test

2014-02-25 Thread Keith S Weintraub
Regarding : ... I don't know what the 4th to last page would be called (could add another ante-, or in R just use tail(book,4))... According to wordsmith.org (sign up it's free, note I have no affiliation to that site) the word is preantepenultimate. Check it out:

Re: [R] plot polar coordinates

2014-02-25 Thread Jim Lemon
Hi, How do we limit the Theta range plotted? In the current format, R plots the whole 2Pi range, however I want a plot between 0 and pi/2. I do not see any parameter in polar.plot to do the same, am I missing something very obvious? Hi Avaneesh, Use the radial.pos argument to provide

[R] [R 3.0.2] Compilation error in toms708.c during installation on Suse using icc

2014-02-25 Thread Guy Moebs
Hello, I have to install R 3.0.2 on a computing center ressources for some of our users and I encounter a compilation error. I take some times to search on the Internet but I find nothing relevant so I send an email to this list. If this is not the right one, please tell me which is more

[R] MatchIt package

2014-02-25 Thread Marwan Khawaja
Hello, I get the following error when running the example in the MatchIt package, demo(analysis) ate.all - c(s.out1$qi$att.ev, -s.out2$qi$att.ev)Error in -s.out2$qi$att.ev : invalid argument to unary operatorIn addition: Warning messages:1: In setx.default(z.out1, data = match.data(m.out1,

[R] Restricted Cubic Spline using rms package

2014-02-25 Thread wong jane
I am trying to use restricted cubic spline to examine the association between an independent variable and outcome. When I plot the relationship between HR and the independent variable, I found the HR is not equal to 1 for the specified reference value. For example: dat - read.table(mydata.csv)

Re: [R] output error in MatchIt

2014-02-25 Thread Ista Zahn
It appears that average treatment effects are not calculated in the version of Zelig currently on CRAN. Note that this is a Zelig issue, not a MatchIt issue. See the missing features section of http://cran.r-project.org/web/packages/Zelig/NEWS. Best, Ista On Mon, Feb 24, 2014 at 9:09 AM, Marwan

Re: [R] Discrepant lm() and survreg() standard errors with weighted fits

2014-02-25 Thread Therneau, Terry M., Ph.D.
On 02/25/2014 05:00 AM, r-help-requ...@r-project.org wrote: Hi, I have some measurements and their uncertainties. I'm using an uncensored subset of the data for a weighted fit (for now---I'll do a fit to the full, censored, dataset when I understand the results). survreg() reports a much

[R] Plots with Y axis split into two scales

2014-02-25 Thread David Parkhurst
I have a Y variable with many values less than 50, and many fewer between 50 and 250.I'd like to plot those Y's against an X, with two scales on the Y axis---maybe 60% of the axis height for 0-50 and the top 40% for 50-250.(I can't use log(Y) because there are many zeroes, and that is the most

[R] png-generation from script (non-X11 env) now broken?

2014-02-25 Thread David Wolfskill
Since ... hmmm.. May 2012, I've had a cron-initiated script running monthly to extract some data and generate some numeric tables and plots (in PNG format). In its normal mode, the script automagically sends its results to a small handful of managers on the first of each month. Out of

[R] Negative binomial distribution mixture model

2014-02-25 Thread Fabian Amman
Dear R community I'm new to R and I'd like to ask for hints how to approach the following problem: I have two vectors of count data 'observed_S' and 'observed_A'. Whereas 'observed_S' follows a neg. binomial distribution but 'observed_A' is a mixture of an unknown variable 'A' (also from a

Re: [R] output error in MatchIt

2014-02-25 Thread Marwan Khawaja
Yes!!..many thanks for your help - seems the problem is still pending! Here it is, Average Treatment Effect quantities of interest are not being included in zelig models temporarily. Simulation of these qi's will return pending a minor update to the 'setx' function. regards Marwan On

[R] ggplot: choropleth map with polygons that have holes

2014-02-25 Thread jlh.membership
I am encountering a problem using *geom_polygon(., fill=.)* with a dataframe created using fortify(map) *if the polygon has holes*. It appears that fill=. ignores the holes - -eg. fills them as if they are not present. geom_path(.) on the other hand does recognize the boundaries of the holes.

Re: [R] how to extract consecutive subvetors of different lengths from an existing vector and create a matrix

2014-02-25 Thread arun
Hi, You could also do: mat1 - matrix(NA,ncol=max(n),nrow=length(n))  mat1[cbind(rep(seq_along(n),n),seq_len(sum(n))- rep(cumsum(c(0L,n[-length(n)])),n))] - y mat1 A.K. On Tuesday, February 25, 2014 10:34 AM, arun smartpink...@yahoo.com wrote: Hi, One way would be: res -

[R] mcr mcreg: Why are BCa and quantile se values calculated, stored, then the stored values set to NA?

2014-02-25 Thread Peter Crowther
In mcreg, there's the following snippet for bootstrap CI method of BCa (and a very similar one for quantile): else if (method.bootstrap.ci == BCa) { bootB0 - mc.calc.bca(Xboot = B0, Xjack = B0jack, xhat = glob.coef[1], alpha) bootB1 - mc.calc.bca(Xboot =

Re: [R] combine 2 data.frames in dependence of the ID

2014-02-25 Thread arun
Hi, May be this helps: dat1 - read.table(text=FS_ID  ABNR 9327    33688812 11391  33688812 11392  33688812 11388  33688812 11390  33688812 12028  33688812 12029  33688812,sep=,header=TRUE) dat2 - read.table(text=FS_ID  DATE  POST 11390  2012-12-13    28 12029  2013-01-17   

Re: [R] Plots with Y axis split into two scales

2014-02-25 Thread Greg Snow
One option is the gap.plot function in the plotrix package. On Tue, Feb 25, 2014 at 10:18 AM, David Parkhurst parkh...@imap.iu.edu wrote: I have a Y variable with many values less than 50, and many fewer between 50 and 250.I'd like to plot those Y's against an X, with two scales on the Y

Re: [R] how to extract consecutive subvetors of different lengths from an existing vector and create a matrix

2014-02-25 Thread arun
Hi, One way would be: res - t(sapply(split(y,rep(seq_along(n),n)),function(x) {if(length(x) max(n)) c(x,rep(NA,max(n)-length(x))) else x})) A.K. Dear all, my question regards how to subset an existing vector in subvectors of different lengths and then create a matrix. See example below.

Re: [R] png-generation from script (non-X11 env) now broken?

2014-02-25 Thread Ista Zahn
Hi David, Did you see https://stat.ethz.ch/pipermail/r-help/2010-March/231778.html ? What does capabilities() tell you? Best, Ista On Tue, Feb 25, 2014 at 1:36 PM, David Wolfskill r...@catwhisker.org wrote: Since ... hmmm.. May 2012, I've had a cron-initiated script running monthly to extract

[R] multinomial mixed logit model mlogit r-package

2014-02-25 Thread Thomas Schlesinger
I discovered the 'mlogit'-package for multinomial logit models in search of estimating a multinomial mixed logit model. After reading the excellent vignette I discovered that I could not apply my data on any of the described examples. I now write in hope of help with my problem and created a

Re: [R] Plots with Y axis split into two scales

2014-02-25 Thread Jeff Newmiller
Please be a good netizen and post plain text on the list. Jim can probably point you to some plotrix function that will do what you ask, but I would encourage you to plot the data twice rather than confusing the audience with nonlinear (discontinuous) scales in a single plot.

Re: [R] png-generation from script (non-X11 env) now broken?

2014-02-25 Thread epi
Hi, You can try to use cairo instead of png. IT doesn’t require X. try putting this line in a Rprofile file : options(bitmapType=cairo) Massimo. On Feb 25, 2014, at 1:36 PM, David Wolfskill r...@catwhisker.org wrote: Since ... hmmm.. May 2012, I've had a cron-initiated script

[R] libPaths how to change (R 3.0.2 64bit, RStudio 0.98.501, Windows 7)

2014-02-25 Thread Lopez, Dan
R Experts, I had a problem when trying to install package tm. The install looked successful (Package 'tm' successfully unpacked and MD5 sums checked) but I could not load it through library(tm). It kept complaining that tm package was not installed. So it was through this problem that I

Re: [R] png-generation from script (non-X11 env) now broken?

2014-02-25 Thread Jeff Newmiller
This is really not new... Google is your friend... http://bit.ly/1fCUnQH... or read FAQ 7.19. The fact that this changed for you seems more like something changed on your end... did your admin remove X11 from your system?

Re: [R] png-generation from script (non-X11 env) now broken?

2014-02-25 Thread David Wolfskill
On Tue, Feb 25, 2014 at 01:45:40PM -0500, epi wrote: Hi, You can try to use cairo instead of png. IT doesn?t require X. try putting this line in a Rprofile file : options(bitmapType=cairo) .. Thank you for the suggestion. Early in the first function my script invokes, I have:

[R] Adding lines to complex xyplot

2014-02-25 Thread Lib Gray
Hello, I am branching out to xyplot for the first time, and I want to layer several complex xyplots. I have tried using panel functions, but so far I lose all complexity from the scatterplot. I would like to have the following things in the plot: 1) A plot of observation vs. modeled individual

Re: [R] About xlsx package and reshape

2014-02-25 Thread arun
Hi, Check the ?str() of testxls.  I guess the two columns studya and studyb, would be character(). I don't have package xlsx installed. So, I read the file using library(XLConnect).  Had the same problem.  You can use ?setMissingValue in XLConnect. library(XLConnect) library(reshape2)  wb -

[R] a question about ks.test

2014-02-25 Thread Shima Shahbazi
Hello, I have two questions about one sided ks.test. First, is there any function in R to find _the critical value_ for this test? I looked at the Z. W. Birnbaum and Fred H. Tingey (1951) paper and I found the formula sqrt(-1/(2n)log(/a/)) but when I use the p-value from ks.test and this

Re: [R] GLM with Numeric and Factor as an Input

2014-02-25 Thread Rolf Turner
On 26/02/14 01:40, Lorenzo Isella wrote: Dear All, Please consider the snippet at the end of the email. It is representative of the problems I am experiencing. I am trying to use glm (without using the formula interface because the original data is quite large) to model the response in a case

Re: [R] Discrepant lm() and survreg() standard errors with weighted fits

2014-02-25 Thread Thomas Lumley
On Tue, Feb 25, 2014 at 10:50 AM, Therneau, Terry M., Ph.D. thern...@mayo.edu wrote: On 02/25/2014 05:00 AM, r-help-requ...@r-project.org wrote: Hi, I have some measurements and their uncertainties. I'm using an uncensored subset of the data for a weighted fit (for now---I'll do a fit

Re: [R] Discrepant lm() and survreg() standard errors with weighted fits

2014-02-25 Thread Kyle Penner
Survreg treats weights as case weights, and lm treats them as sampling weights. Here is a simple example. Data set test2 has two copies of every obs in data set test. test - data.frame(x=1:6, y=c(1,3,2,4,6,5)) test2 - test[c(1:6, 1:6),] summary(lm( y ~ x, data=test))$coef

Re: [R] a question about ks.test

2014-02-25 Thread Greg Snow
I think both of your questions can be answered using simulations. If you simulate a bunch of datasets where the null hypothesis is true (data comes from the candidate distribution or 2 sets come from the same distribution) and compute the KS statistic for each (you can use the ks.test function

[R] SEs rms cph vs survey svycoxph

2014-02-25 Thread Nathan Pace
I¹ve used twang to get ATE propensity scores. I¹ve done multivariable, case weighted Cox PH models in survey using svycoxph and in rms using cph with id(cluster) set to get robust estimates. The model language is identical. The point estimates are identical, but the CIs are considerably wider

Re: [R] Adding lines to complex xyplot

2014-02-25 Thread Robert Latest
Hello Lib, I think what you're trying to do is very easy using ggplot2 -- easy, that is, once you got your hear around ggplot2 in the first place. The layering you mention is the core feature of ggplot2. Fortunately it is well-documented including a thin, overpriced book from Springer (which I

Re: [R] png-generation from script (non-X11 env) now broken?

2014-02-25 Thread David Wolfskill
On Tue, Feb 25, 2014 at 11:10:12AM -0800, Jeff Newmiller wrote: This is really not new... Google is your friend... http://bit.ly/1fCUnQH... or read FAQ 7.19. The fact that this changed for you seems more like something changed on your end... did your admin remove X11 from your system? ... I

Re: [R] matrix merging question

2014-02-25 Thread Elio Shijaku
Hi Arun, Yes, I figured that, thanks a lot for your help. Howver, when I test res1 for symmetricity I get: isSymmetric(unname(res1))[1] FALSE I need the final matrix to be symmetric. Any idea? E. On Tue, Feb 25, 2014 at 10:14 PM, arun smartpink...@yahoo.com wrote: Hi, Sorry, a typo:

Re: [R] Environmental problems.

2014-02-25 Thread Rolf Turner
Please see at end. On 26/02/14 01:13, Duncan Murdoch wrote: On 14-02-25 3:08 AM, Rolf Turner wrote: I have a function that makes use of the ode() function from the deSolve package. I am trying to find a way of getting it to put out a progress report every t.int time units (by progress

Re: [R] matrix merging question

2014-02-25 Thread Elio Shijaku
Hi Arun, Great, many thanks again and sorry for the confusion, Since this is going to the forum, I also found a way to merge symmetric matrices (just two, hence the question on multiple symmetric matrix merge), I can post it here for future reference by other users: ix -

Re: [R] SEs rms cph vs survey svycoxph

2014-02-25 Thread Thomas Lumley
On Tue, Feb 25, 2014 at 2:51 PM, Nathan Pace n.l.p...@utah.edu wrote: I¹ve used twang to get ATE propensity scores. I¹ve done multivariable, case weighted Cox PH models in survey using svycoxph and in rms using cph with id(cluster) set to get robust estimates. The model language is

Re: [R] Environmental problems.

2014-02-25 Thread Rolf Turner
On 26/02/14 00:56, Enrico Schumann wrote: SNIP I did not follow your example, neither do I use the deSolve package; but why not pass an environment as an argument? ## some iterative function that takes another fun as argument outer - function(fun, ...) { for (i in 1:20)

Re: [R] Environmental problems.

2014-02-25 Thread Duncan Murdoch
On 14-02-25 4:43 PM, Rolf Turner wrote: Please see at end. On 26/02/14 01:13, Duncan Murdoch wrote: On 14-02-25 3:08 AM, Rolf Turner wrote: I have a function that makes use of the ode() function from the deSolve package. I am trying to find a way of getting it to put out a progress report

Re: [R] [SOLVED -- my fault] png-generation from script (non-X11 env) now broken?

2014-02-25 Thread David Wolfskill
On Tue, Feb 25, 2014 at 10:36:29AM -0800, David Wolfskill wrote: ... This morning, I found a message in my mailbox from such a preview run: | Error in .External2(C_X11, paste(png::, filename, sep = ), g$width, : | unable to start device PNG | Calls: gen_build_histogram - png | In

[R] plot out the predicted values and the upper and lower limits

2014-02-25 Thread varin sacha
Hi, I have realized a multiple linear regression.  To know how well my model does in terms of prediction, I can compute prediction intervals bands and decide if they are narrow enough to be of use. If they are too wide, then they probably are not useful. So what I am trying to do is :

Re: [R] matrix merging question

2014-02-25 Thread arun
Hi, I am not sure about your final result.  In your initial post, you mentioned but with row names that need to be matched.  Anyway, this gives me symmetric matrix ##rownames are the same as colnames for each matrix, so: uNrownames - unique(as.vector(sapply(lst2,rownames))) res -

Re: [R] matrix merging question

2014-02-25 Thread arun
HI Elio, Not sure whether this helps: length(list.files(pattern=.txt)) #[1] 22  lst1 - lapply(list.files(pattern=.txt),function(x) read.table(x,header=TRUE,stringsAsFactors=FALSE))  sapply(lst1,dim)  sapply(lst1,function(x) all(apply(rbind(colnames(x),rownames(x)),2,function(y) y[1]==y[2])))  

[R] R: Re: how to extract consecutive subvetors of different lengths from an existing vector and create a matrix

2014-02-25 Thread bex
Thank you Arun! Le mail ti raggiungono ovunque con BlackBerry® from Vodafone! -Original Message- From: arun kirshna [via R] ml-node+s789695n4685806...@n4.nabble.com Date: Tue, 25 Feb 2014 10:54:10 To: bexelisabetta.petra...@gmail.com Subject: Re: how to extract consecutive subvetors of

Re: [R] matrix merging question

2014-02-25 Thread arun
Hi, Sorry, a typo:  res1[rownames(mat1),] - res[rownames(mat1),] + mat1   ###should be: res1[rownames(mat1),] - res1[rownames(mat1),] + mat1 A.K. On Tuesday, February 25, 2014 4:03 PM, arun smartpink...@yahoo.com wrote: HI Elio, Not sure whether this helps:

[R] A couple of issues with lattice::bwplot

2014-02-25 Thread Ravi Varadhan
Hi All, I am using lattice::bwplot to plot the results of a subgroup analysis for different simulation scenarios. I have 4 subgroups, 5 methods of estimating treatment effect in subgroups, and 4 scenarios. I am plotting the subgroup effect and its upper and lower CI. I have 2 issues that I

Re: [R] A couple of issues with lattice::bwplot

2014-02-25 Thread Gabor Grothendieck
On Tue, Feb 25, 2014 at 4:49 PM, Ravi Varadhan ravi.varad...@jhu.edu wrote: Hi All, I am using lattice::bwplot to plot the results of a subgroup analysis for different simulation scenarios. I have 4 subgroups, 5 methods of estimating treatment effect in subgroups, and 4 scenarios. I am

Re: [R] Adding lines to complex xyplot

2014-02-25 Thread Duncan Mackay
Hi Once you want to do extra things from the basic you may have to go into the panel function xyplot(Observation,IPrediction, groups=TreatmentArm, col = c(1,2,3), cex=0.7, panel = function(x,y,...){

Re: [R] A couple of issues with lattice::bwplot

2014-02-25 Thread Duncan Mackay
Hi Ravi str(estimates) 'data.frame': 240 obs. of 4 variables: $ Tx.effect: num -0.2321 -0.1097 0.0409 0.0546 0.1069 ... $ method : chr Bayes-DS Bayes-DS Bayes-DS Bayes-DS ... $ name : chr X0=0, scenario1 X0=1, scenario1 X1=0, scenario1 X1=1, scenario1 ... $ type : chr Point

Re: [R] SEs rms cph vs survey svycoxph

2014-02-25 Thread Nathan Pace
Here are the model outputs. Nathan Survey package ca.ATE.design - svydesign(ids = ~ id, weights = ~ get.weights(ca.ATE.ps, stop.method = 'ks.mean'), data = ca.dt) Independent Sampling design (with replacement) svydesign(ids = ~id, weights = ~get.weights(ca.ATE.ps, stop.method = ks.mean),

Re: [R] plot out the predicted values and the upper and lower limits

2014-02-25 Thread Rolf Turner
On 26/02/14 11:57, varin sacha wrote: Hi, I have realized a multiple linear regression. To know how well my model does in terms of prediction, I can compute prediction intervals bands and decide if they are narrow enough to be of use. If they are too wide, then they probably are not useful.

Re: [R] Environmental problems.

2014-02-25 Thread Duncan Murdoch
Rolf Turner wrote: Somehow I managed *not* to cc to R-help the message that I just sent to you. I thought I'd clicked on Reply All but apparently not. And in thrashing around trying to recover, I managed not to get a copy kept in my Sent Mail!!! Could I please prevail upon you to pass that

[R] R Progress Bar

2014-02-25 Thread slomanl1
When I run my script, the progress bar is always minimized, and I have to manually click on it to be visible. Does anyone know how to put an R progress bar on top once it is created? -- View this message in context: http://r.789695.n4.nabble.com/R-Progress-Bar-tp4685847.html Sent from the R

Re: [R] ddply

2014-02-25 Thread arun
Hi Felipe, Pasting the code from your second email with ?which.max() #changed 'test' to `hw` as hw2 - ddply(hw,id,summarise, subSiteName=unique(subSiteName),nReleased=unique(nReleased),                                        

Re: [R] Plots with Y axis split into two scales

2014-02-25 Thread Jim Lemon
I have a Y variable with many values less than 50, and many fewer between 50 and 250.I'd like to plot those Y's against an X, with two scales on the Y axis---maybe 60% of the axis height for 0-50 and the top 40% for 50-250.(I can't use log(Y) because there are many zeroes, and that is the

Re: [R] Plots with Y axis split into two scales

2014-02-25 Thread Peter Alspach
Another suggestion - would a square-root scale work for you? Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Lemon Sent: Wednesday, 26 February 2014 3:00 p.m. To: David Parkhurst Cc: r-help@r-project.org Subject: