[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-help
Subject:    [R] conditional regression with mgcv
From:       Dean Force <deanforce14 () gmail ! com>
Date:       2017-03-31 15:58:10
Message-ID: CAEd09GSbJ1D6j6exLuR3X66=aOAvgXvjLwtvwVaZ8TY3yezg3A () mail ! gmail ! com
[Download RAW message or body]

Hello,


As a part of a larger project, I am trying to run a conditional logistic
regression to look at whether maternal age is implicated in the risk of
developing gestational diabetes. I am using a matched case-control design,
where mothers with GDM were individually matched with up to 6 controls
based on several parameters.


I run the following model:


model <- gam(gdm ~ s(maternal_age, bs="cr") + strata(risk_set) +
as.factor(district) + as.factor(riskfactor1)+as.factor(riskfactor2), data =
dt, family=cox.ph(), weights = wt)



weights are defined as 0 for censoring, 1 for event, and each subject has
one event/censoring time and one row of covariate values. In total there
are 1000 cases, matched to 5500 controls, so there are 1000 risk_set that I
define as strata.

When running the model, I keep getting the following error: "Error in
xat[[i]] : subscript out of bounds". Am I doing something wrong?

Using mgcv_1.8.



Thank you!

	[[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic