Re: [R] Running segmented on grouped data and collating model parameters in a data frame

2018-06-04 Thread Vito M. R. Muggeo
dear Sumi, I am not familiar with the dplyr package (%>%..), however if you want to fit the model for each subject times freq interaction, a simple for loop will suffice. Here possible code: Assuming d is the dataframe, something like subj<-levels(d$subject) fr<-unique(d$freq) #new

[R] removing part of a string

2018-05-21 Thread Vito M. R. Muggeo
dear all, I am stuck on the following problem. Give a string like ss1<- "z:f(5, a=3, b=4, c='1:4', d=2)" or ss2<- "f(5, a=3, b=4, c=\"1:4\", d=2)*z" I would like to remove all entries within parentheses.. Namely, I aim to obtain respectively "z:f()" or "f()*z" I played with sub() and

[R] variable names in lm formula ~.

2018-01-30 Thread Vito M. R. Muggeo
dear all, Is the following intentional? Am I missing anything in documentation? d<-data.frame(y=rnorm(10,5,.5),exp=rnorm(10), age=rnorm(10)) formula(lm(exp(y)~exp+age, data=d)) #--> exp(y) ~ exp + age formula(lm(exp(y)~., data=d)) #--> exp(y) ~ age variable 'exp' (maybe indicating

Re: [R] how to manipulate ... in the argument list

2016-05-11 Thread Vito M. R. Muggeo
Hi Witold, use do.call() list.args<-list(...) #modify 'list.args' (add/delete/modify) do.call(image, list.args) best, vito Il 11/05/2016 10.45, Witold E Wolski ha scritto: Hi, I am looking for a documentation describing how to manipulate the "..." . Searching R-intro.html gives to many

Re: [R] Help required for Rcmdr

2016-02-09 Thread Vito M. R. Muggeo
dear all, I don't know if that problem is related to the Rcmdr package itself.. (Sekhar try to install any other packages..) I am experiencing the same problem, in that when typing > install.packages("_ANY_PACKAGE_") I get the message Warning message: package ‘_ANY_PACKAGE_’ is not available

Re: [R] Help required for Rcmdr

2016-02-09 Thread Vito M. R. Muggeo
McMaster University Hamilton, Ontario Canada L8S 4M4 web: socserv.mcmaster.ca/jfox From: R-help [r-help-boun...@r-project.org] on behalf of Vito M. R. Muggeo [vito.mug...@unipa.it] Sent: February 9, 2016 10:15 AM To: Sekhar Venkatesan; Duncan Murdoch; R-help@r

Re: [R] computing AIC when distribution is fitted by lmom or lmomco

2015-05-05 Thread Vito M. R. Muggeo
dear Milan, I think you should consult a (local) statistician for your analyses. R (and packages) are only software, and you need theoretical background. best, vito Il 05/05/2015 14.25, Milan Cisty ha scritto: Dear list members, Is it possible to compute in R AIC, when model was fitted by

Re: [R] Segmented (piecewise linear) regression/cointegration

2015-03-18 Thread Vito M. R. Muggeo
dear jpm, segmented can't deal with I(1) regression.. However the segmented default method could be used on objects fitted by any function which fits I(1) *linear* regression, Please contact me off list for details, best, vito Il 18/03/2015 2.16, jpm miao ha scritto: Hi, If the

Re: [R] nonmonotonic glm?

2015-01-12 Thread Vito M. R. Muggeo
dear Stanislav, Your data show two slopes with a kink at around 0. Thus, yet another approach would be to use segmented regression to fit a piecewise linear relationship with unknown breakpoint (being estimated as part of model fitting). While the resulting fitting is likely to be (slightly)

[R] summary.lm() for zero variance response

2014-03-12 Thread Vito M. R. Muggeo
dear all, a student of mine brought to my attention the following, somewhat odd, behaviour of summary.lm() when the response variance is zero (yes, possibly meaningless from a practical viewpoint). Namely something like n=10;k=1;summary(lm(rep(k,n)~rnorm(n))) The values of k, n and the

Re: [R] summary.lm() for zero variance response

2014-03-12 Thread Vito M. R. Muggeo
() R version 3.0.2 (2013-09-25) Platform: x86_64-w64-mingw32/x64 (64-bit) -Original Message- From: Vito M. R. Muggeo [mailto:vito.mug...@unipa.it] Sent: Wednesday, March 12, 2014 6:27 AM To: r-help@r-project.org Subject: [R] summary.lm() for zero variance response dear all, a student

Re: [R] Interpretation / Usage of davies.test

2014-02-17 Thread Vito M. R. Muggeo
dear Katie, Since you are looking for exactly 1 breakpoint (namely you know the number of breakpoints), I suggest to use bootstrap restarting (default in segmented) with the rough value from davies.test() as a starting value, namely o-davies.test(reg1.2,~lagBYmean)

Re: [R] growth curve estimation

2013-12-09 Thread Vito M. R. Muggeo
dear Daniel, yet another package performing growth modelling is quantregGrowth. It uses quantile regressions with B-splines and quadratic penalties to ensure flexible estimation with additional noncrossing and monotonicity (optional) constraints. The paper underlying the package is here: