我必须创建一个协变量模型,但是我不确定如何处理诸如性别这样的分类变量。 obfj 与非协变模型的 obfj 相同。
我的数据源是
阿莫司<- read_csv("https://raw.githubusercontent.com/dlonsdal/SGUL_PK_data/main/assignment_2/pkdata.csv")
我使用的代码:
one.cmt.Sex <- function() {
ini({
tcl <- log(15)
tv <- log(20)
SEXe<--0.3
eta.cl ~ 0.1
eta.v ~ 0.1
add.sd <- 0.01
})
model({
cl <- exp(tcl + eta.cl)*(1+SEX*SEXe)
v <- exp(tv + eta.v)
linCmt() ~ add(add.sd)
})
}
nlmixr2(one.cmt.Sex)
Sexfit<- nlmixr2(one.cmt.Sex, amox, est="saem", list(print=0), table = tableControl(cwres = TRUE))
Sexfit$objf