Displaying 20 results from an estimated 1000 matches similar to: "Ridge regression and mixed models"
2010 Oct 18
1
Question about lme (mixed effects regression)
Hello!
If I run this example:
library(nlme)
fm1 <- lme(distance ~ age+Sex, Orthodont, random = ~ age + Sex| Subject)
If I run:
summary(fm1)
then I can see the fixed effects for age and sex (17.7 for intercept,
0.66 for age, and -1.66 for SexFemale)
If I run:
ranef(fm1)
Then it looks like it's producing the random effects for each subgroup
(in this example - each subject). For example,
2006 Apr 13
3
Penalized Splines as BLUPs using lmer?
Dear R-list,
I?m trying to use the lmer of the lme4 package to fit a linear mixed model
of the form
Y = Xb + Zu + e
and I can?t figure out how to control the covariance structure of u. I want
u ~ N(0,sigma^2*I).
More precisely I?m trying to smooth a curve through data using the
"Penalized Splines as BLUPs" method as described in Ruppert, Wand &
Carroll (2003).
So I have Z = [Z1
2009 Aug 01
2
Cox ridge regression
Hello,
I have questions regarding penalized Cox regression using survival
package (functions coxph() and ridge()). I am using R 2.8.0 on Ubuntu
Linux and survival package version 2.35-4.
Question 1. Consider the following example from help(ridge):
> fit1 <- coxph(Surv(futime, fustat) ~ rx + ridge(age, ecog.ps, theta=1), ovarian)
As I understand, this builds a model in which `rx' is
2010 Feb 16
1
penalized package for ridge regression
Dear all,
I am using "penalized" package for "Ridge" regression. I do
not know how can I get regression coefficients using that package . Please
help me.
Thanks
--
Linda Garcia
[[alternative HTML version deleted]]
2010 Feb 16
1
survival - ratio likelihood for ridge coxph()
It seems to me that R returns the unpenalized log-likelihood for the ratio likelihood test when ridge regression Cox proportional model is implemented. Is this as expected?
In the example below, if I am not mistaken, fit$loglik[2] is unpenalized log-likelihood for the final estimates of coefficients. I would expect to get the penalized log-likelihood. I would like to check if this is as expected.
2010 Dec 09
1
survival: ridge log-likelihood workaround
Dear all,
I need to calculate likelihood ratio test for ridge regression. In February I have reported a bug where coxph returns unpenalized log-likelihood for final beta estimates for ridge coxph regression. In high-dimensional settings ridge regression models usually fail for lower values of lambda. As the result of it, in such settings the ridge regressions have higher values of lambda (e.g.
2011 Apr 27
0
treatment of factors and errors in ridge() function with coxph
I am trying to fit a large Cox model with many predictors. Because
there are many predictors, I would like to use the ridge() function to
get penalized ml estimates for all coefficients. The problems are that:
1. When I include a factor (like race) in the ridge() function, dummy
variables are not created. The resulting model has a single
coefficient for the race variable, and I have
2012 Jul 06
4
Poisson Ridge Regression
Dear everyone
I'm dealing with a problem related to Poisson Ridge Regression. If
anyone can help me in this regard by telling if any changes in the
source code of "glm.fit" may help
--
Regards
Umesh Khatri
2003 Jun 05
2
ridge regression
Hello R-user
I want to compute a multiple regression but I would to include a check for
collinearity of the variables. Therefore I would like to use a ridge
regression.
I tried lm.ridge() but I don't know yet how to get p-values (single Pr() and p
of the whole model) out of this model. Can anybody tell me how to get a
similar output like the summary(lm(...)) output? Or if there is
2010 Oct 01
3
Suppressing printing in the function
Hello!
I wrote a function that returns a data frame. Nowhere in the function
do I say print(my.data.frame), but when I run the function - the data
frame is printed on the console.
Is there any way to suppress it?
Thank you!
--
Dimitri Liakhovitski
Ninah Consulting
www.ninah.com
2011 Feb 24
4
Running code sequentially from separate scripts (but not functions)
Hello!
I am wondering if it's possible to run - in sequence - code that is
stored in several R scripts.
For example:
Script in the file "code1.r" contains the code:
a = 3; b = 5; c = a + b
Script in the file "code2.r" contains the code:
d = 10; e = d - c
Script in the file "code3.r" contains the code:
result=e/a
I understand that I could write those 3 scripts
2011 Feb 25
6
preventing repeat in "paste"
Hello!
s<-"start"; e<-"end"
middle<-as.character(c(1,2,3))
I would like to get the following result:
"start 123 end" or "start 1 2 3 end" or "start 1,2,3 end"
How can I avoide this (undesired) result:
paste(s,middle,e,sep=" ")
Thank you!
--
Dimitri Liakhovitski
Ninah Consulting
www.ninah.com
2009 Oct 13
4
replacing period with a space
Dear R-ers!
I have x as a variable in a data frame x.
x<-data.frame(x=c("aa.bb","cc.dd.ee"))
x$x<-as.character(x$x)
x
I am sorry for such a simple question - but how can I replace all
periods in x$x with spaces?
sub('.', ' ', x$x) - removes all letters to the left of each period...
Thanks a lot for your advice!
--
Dimitri Liakhovitski
Ninah.com
2009 Mar 17
1
Likelihood of a ridge regression (lm.ridge)?
Dear all,
I want to get the likelihood (or AIC or BIC) of a ridge regression model
using lm.ridge from the MASS library. Yet, I can't really find it. As
lm.ridge does not return a standard fit object, it doesn't work with
functions like e.g. BIC (nlme package). Is there a way around it? I would
calculate it myself, but I'm not sure how to do that for a ridge regression.
Thank you in
2010 Mar 04
4
Analogue to SPSS regression commands ENTER and REMOVE in R?
I am not sure if this question has been asked before - but is there a
procedure in R (in lm or glm?) that is equivalent to ENTER and REMOVE
regression commands in SPSS?
Thanks a lot!
--
Dimitri Liakhovitski
Ninah.com
Dimitri.Liakhovitski at ninah.com
2009 Jun 04
0
help needed with ridge regression and choice of lambda with lm.ridge!!!
Hi,
I'm a beginner in the field, I have to perform the ridge regression with lm.ridge for many datasets, and I wanted to do it in an automatic way.
In which way I can automatically choose lambda ?
As said, right now I'm using lm.ridge MASS function, which I found quite simple and fast, and I've seen that among the returned values there are HKB estimate of the ridge constant and L-W
2011 Mar 30
3
optim and optimize are not finding the right parameter
Dear all,
I have a function that predicts DV based on one predictor pred:
pred<-c(0,3000000,7800000,15600000,23400000,131200000)
DV<-c(0,500,1000,1400,1700,1900)
## I define Function 1 that computes the predicted value based on pred
values and parameters a and b:
calc_DV_pred <- function(a,b) {
DV_pred <- rep(0,(length(pred)))
for(i in 1:length(DV_pred)){
DV_pred[i] <- a *
2011 Aug 06
0
ridge regression - covariance matrices of ridge coefficients
For an application of ridge regression, I need to get the covariance
matrices of the estimated regression
coefficients in addition to the coefficients for all values of the ridge
contstant, lambda.
I've studied the code in MASS:::lm.ridge, but don't see how to do this
because the code is vectorized using
one svd calculation. The relevant lines from lm.ridge, using X, Y are:
2010 Mar 30
4
Code is too slow: mean-centering variables in a data frame by subgroup
Dear R-ers,
I have a large data frame (several thousands of rows and about 2.5
thousand columns). One variable ("group") is a grouping variable with
over 30 levels. And I have a lot of NAs.
For each variable, I need to divide each value by variable mean - by
subgroup. I have the code but it's way too slow - takes me about 1.5
hours.
Below is a data example and my code that is too
2010 May 08
1
Increasing the font size on axes in trellis
Hello,
the code below gives me the picture I need - but there is on small
thing I can't figure out.
The plot has very small tick mark labels for both axes. I don't mean
the axis labels - they are both good, but what is shown near the tick
marks.
Please help me figure out what parameter I should add to make those
larger. I tried sticking cex.lab=1.3 in different places but it didn't