Displaying 20 results from an estimated 2000 matches similar to: "Piecewise Lasso Regression"
2024 Jul 26
1
Automatic Knot selection in Piecewise linear splines
dear all,
I apologize for my delay in replying you. Here my contribution, maybe
just for completeness:
Similar to "earth", "segmented" also fits piecewise linear relationships
with the number of breakpoints being selected by the AIC or BIC
(recommended).
#code (example and code from Martin Maechler previous email)
library(segmented)
o<-selgmented(y, ~x, Kmax=20,
2024 Jul 16
2
Automatic Knot selection in Piecewise linear splines
>>>>> Anupam Tyagi
>>>>> on Tue, 9 Jul 2024 16:16:43 +0530 writes:
> How can I do automatic knot selection while fitting piecewise linear
> splines to two variables x and y? Which package to use to do it simply? I
> also want to visualize the splines (and the scatter plot) with a graph.
> Anupam
NB: linear splines, i.e. piecewise
2009 Jun 23
1
gradually switching regression
Hello,
I'm trying to find an algorithm to estimate a switching regression model
based on the 1990 Economics Letters paper by Ohtani/Kakimoto/Abe or the
earlier version from 1985 (Ohtani/Katayama, Economic Studies Quarterly;
assuming as a transition path a polynomial of order 1).
I found an idea for using nls here:
http://www.biostat.wustl.edu/archives/html/s-news/2000-04/msg00223.html.
2009 Jul 14
1
Linear Regression Problem
Dear All,
I have a matrix say, X ( 100 X 40,000) and a vector say, y
(100 X 1) . I want to perform linear regression. I have scaled X matrix by
using scale () to get mean zero and s.d 1 . But still I get very high
values of regression coefficients. If I scale X matrix, then the regression
coefficients will bahave as a correlation coefficient and they should not be
more than 1.
2008 Jun 30
2
difference between MASS::polr() and Design::lrm()
Dear all,
It appears that MASS::polr() and Design::lrm() return the same point
estimates but different st.errs when fitting proportional odds models,
grade<-c(4,4,2,4,3,2,3,1,3,3,2,2,3,3,2,4,2,4,5,2,1,4,1,2,5,3,4,2,2,1)
score<-c(525,533,545,582,581,576,572,609,559,543,576,525,574,582,574,471,595,
557,557,584,599,517,649,584,463,591,488,563,553,549)
library(MASS)
library(Design)
2010 Mar 04
1
only actual variable names in all.names()
dear all,
When I use all.vars(), I am interest in extracting only the variable names..
Here a simple example
all.vars(as.formula(y~poly(x,k)+z))
returns
[1] "y" "x" "k" "z"
and I would like to obtain
"y" "x" "z"
Where is the trick?
many thanks
vito
--
====================================
Vito M.R. Muggeo
Dip.to Sc
2010 Oct 25
1
building lme call via call()
dear all,
I would like to get the lme call without fitting the relevant model.
library(nlme)
data(Orthodont)
fm1 <- lme(distance ~ age, random=list(Subject=~age),data = Orthodont)
To get fm1$call without fitting the model I use call():
my.cc<-call("lme.formula", fixed= distance ~ age, random = list(Subject
= ~age))
However the two calls are not the same (apart from the data
2009 Nov 02
3
partial matching with grep()
dear all,
This is a probably a silly question.
If I type
> grep("x",c("a.x" ,"b.x","a.xx"),value=TRUE)
[1] "a.x" "b.x" "a.xx"
Instead, I would like to obtain only
"a.x" "b.x"
How is it possible to get this result with grep()?
many thanks for your attention,
best,
vito
--
2010 May 26
3
Peak Over Threshold values
Dear List
I hope you can help me: I?ve got a dataframe (df) within which I am looking
for Peak Over Threshold values as well as the length of the events. An event
starts when walevel equals 5.8 and it should end when walevel equals the
lower threshold value (5.35).
I tried ?clusters (?)? from ?evd package?, and varied r (see example) but it
did not work for all events (again
2012 Apr 26
1
variable dispersion in glm models
Hello,
I am currently working with the betareg package, which allows the fitting of a variable dispersion beta regression model (Simas et al. 2010, Computational Statistics & Data Analysis). I was wondering whether there is any package in R that allows me to fit variable dispersion parameters in the standard logistic regression model, that is to make the dispersion parameter contingent upon
2011 Jan 18
2
Convert a matrix's columns to list
Dear R,
Is there an efficient way to make a list that each element is from the
corresponding column of a matrix. For example, if I have a matrix "a"
> a <- matrix(1:10, 5, 2)
> a
[,1] [,2]
[1,] 1 6
[2,] 2 7
[3,] 3 8
[4,] 4 9
[5,] 5 10
I would like to have a list "b" like this
> b <- list(a[, 1], a[, 2])
> b
[[1]]
[1] 1 2 3
2011 Jan 18
1
Choosing statistical test - Fisher's Exact Test?
Hi I was wondering whether anyone can help me with this problem....it's been
driving me nuts, I've been trying to figure it out for months and months
without success!! Basically I have a group of participants who attended 2
experimental sessions a few months apart. I took measures of the way they
approach two tasks at Time 1 and the same two tasks at Time 2. I have
categorical data (a
2011 Jan 28
1
plot not generic
Hello list.
I was trying to see some of the code for plot.glmnet in package glmnet (this
function name is in the documentation).
After loading the library, I tried the obvious typing in the name, but I
received a message telling me it could not be found.
So I fiddled around a little, and noticed that R does not recognize ''plot''
as a generic function, and as such,
2012 Jan 10
1
Problem with segmented
Hi everyone.
I'm trying to use the segmented function with the following data:
For instance, I use segmented package as follow:
myreg2 = lm(xy$y ~ xy$x)
mysegmented = segmented(myreg2, seg.Z=~x, psi=c(245000), control =
seg.control(display=FALSE))
Which get me to the following error :
As a break point, a starting guess of 245000 seems fair.
Anyone has an idea why I'm getting such
2012 Apr 02
2
linear-by-linear association model in R?
Dear all, can somebody give me some pointer how I can fit a
"linear-by-linear association model" (i.e. loglinear model for the
ordinal variables) in R? A brief description can be found here
'https://onlinecourses.science.psu.edu/stat504/node/141'.
Thanks for your help
2012 May 03
1
Error with the 'segmented' package for R
Hi everyone,
I have encountered this problem while using 'segmented' plugin for R i386 2.15.0 (for Windows 32bit OS) and I just cannot find neither explanation nor solution for it.
I am trying to run this data
gpp temp
1.661 5
5.028 10
9.772 15
8.692 20
5.693 25
6.293 30
7.757 5
4.604 10
8.763 15
8.134 20
4.616 25
8.417 30
3.483 5
5.046 10
8.306 15
9.142 20
4.686 25
7.301 30
and with
2012 Jul 05
1
Comparing crossing survival curves
Hi
I want to compare the survival curves in two groups. Because the hazards are
not proportional (the curves cross) the log rank test or Cox proportional
hazard test are not suitable. How should such curves be compared? Comands
are welcome....
Thanks in advance
2012 Jun 01
1
Finding multiple breakpoints - 'segmented' ?
Hello,
I'm attempting to find multiple breakpoints in an association of my
response variable (R.AUC) with two explanatory variables ('s.size' and
'bedekking'). The association between 's.size' and 'R.AUC' shows a
plateau, but the value when this plateau is reached is differs for
different values of 'bedekking'.
Initially I thought these different
2009 Sep 08
2
Fitting a linear model with a break point
Hello,
I would like to test some data to see whether it has the shape of a step
function (i.e. y1 up until x_th and then y2 where x_th is the
threshold). The threshold x_th is unknown and the x values can only
take discrete values (0,1,2,3,4).
An example would be:
data<- data.frame(x=1:20,y=c(rnorm(10),rnorm(10,10)))
I was thinking along the lines of fitting some sort of piiecewise linear
2010 Nov 30
1
confidence interval for logistic joinpoint regression from package ljr
I?m trying to run a logistic joinpoint regression utilising the ljr package. I?ve been using the forward selection technique to get the number of knots for the analysis, but I?m uncertain as to my results and the interpretation. The documentation is rather brief ( in the package and the stats in medicine article is quite technical) and without any good examples. At the moment I?m thinking
1)find