# Troubleshooting covariate lines

**URL:** https://isgw-forum.colorado.edu/t/troubleshooting-covariate-lines/332
**Category:** Day 3
**Created:** [June 9, 2022, 5:40pm UTC](https://isgw-forum.colorado.edu/t/troubleshooting-covariate-lines/332 "2022-06-09T17:40:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hallerl1](https://isgw-forum.colorado.edu/letter_avatar_proxy/v4/letter/h/e8c25b/32.png) [@hallerl1](https://isgw-forum.colorado.edu/u/hallerl1)
#### Post date: [June 9, 2022, 5:40pm UTC](https://isgw-forum.colorado.edu/t/troubleshooting-covariate-lines/332/1 "2022-06-09T17:40:26Z")

</div>

Hi! I wanted to better understand lines 57 and 58 from Day3’s practical regarding the inclusion of age as a covariate.

The lines are:  
defAge ← mxMatrix( type=“Full”, nrow=1, ncol=1, free=FALSE, labels=c(“data.age”), name=“defL” )  
pathB ← mxMatrix( type=“Full”, nrow=1, ncol=1, free=TRUE, values=0.01, label=“b11”, name=“beta” )

1. Can you explain what each portion in the parenthesis is referring to. For instance, what is “data.age”?
2. Is pathB for the covariate?

Thanks!

---

<div class="post-metadata">

### Author: ![rkirkpatrick2](https://isgw-forum.colorado.edu/user_avatar/isgw-forum.colorado.edu/rkirkpatrick2/32/612_2.png) [@rkirkpatrick2](https://isgw-forum.colorado.edu/u/rkirkpatrick2)
#### Post date: [June 9, 2022, 8:30pm UTC](https://isgw-forum.colorado.edu/t/troubleshooting-covariate-lines/332/2 "2022-06-09T20:30:55Z")

</div>

> 1. Can you explain what each portion in the parenthesis is referring to. For instance, what is “data.age”?

OK. Consider `defAge`. `type="Full"` says that it is a “full” matrix, which can be of any dimensions, and in which every element may have a unique value. `nrow=1, ncol=1` says that it will have 1 row and 1 column. `free=FALSE` because it does not contain any free parameters. In the MxModel’s namespace, it will be named “defL”. That leaves the tricky part, `labels=c("data.age")`.

In an MxModel’s namespace, “data” always refers to the MxModel’s MxData object. Also, OpenMx interprets a period as meaning “member of”, _a la_ C/C++. Thus, “data.age” refers to the variable damed “age” in the dataset.

Assuming the rows of the dataset are sampled independently, the -2logL of the full dataset is the sum of the -2logLs across all rows. That is, OpenMx evaluates the -2logL for each row, and sums them up to get the total -2logL. When OpenMx evaluates the -2logL for each row, the MxMatrix named “defL” will be populated with the value of the “age” variable specific to that row. Thus, the model-expected means for each row are conditioned upon each row’s value of age.

> 1. Is pathB for the covariate?

Yes. It contains the regression coefficient from the regression of the phenotype onto age.
