Discussion:
[R-sig-ME] Single DV with multiple measures for time-varying IV?
Pero, Ellen
2018-11-12 18:58:03 UTC
Permalink
Hi all:

I have an analytical dilemma wherein I have a single DV with multiple categorical and continuous IVs (one of which is a continuous IV that has multiple measurements across time). I'm not sure the best way to model for this - though it's clearly a hierarchical situation so I thought this might be a good venue to pose the question.

Specifically, I have 60 pregnant elk from which I took monthly cortisol samples across gestation (some missing values, so 5-8 samples/female across gestation). I'm interested in how those stress measurements across gestation (along with a range of other IVs that don't vary with time, e.g., dam age, sire age, calf birthdate) influence the birth mass of each female's calf.

Any suggestions on analysis for situations where a single DV is predicted by longitudinal measures of time-varying IV (along with non-varying IVs)?

I'm new to this list and will spend some time familiarizing myself with it - but was eager to get my question out. Apologies if this isn't the right venue for my non-development related question. Please disregard if appropriate.

I appreciate any thoughts/advice/suggestions!
El



Ellen Pero
PhD Student
Wildlife Biology Program
W.A. Franke College of Forestry and Conservation
University of Montana
32 Campus Drive, FOR 318
Missoula, MT 59812


[[alternative HTML version deleted]]
Bill Poling
2018-11-19 11:26:52 UTC
Permalink
Hi Ellen.

If the data frame is not too terribly large, a dput() would be useful.
See ?dput()
Or a str() would help as well
See ?str()
However, as Thierry suggests a subset of your data would be most helpful.

I will be interested to follow this topic as I am teaching myself R and learning the various modeling methods and their purposes along the way.

I think you will gain considerable support from this list relevant to your topic.

Best regards.

WHP


From: R-sig-mixed-models <r-sig-mixed-models-***@r-project.org> On Behalf Of Thierry Onkelinx via R-sig-mixed-models
Sent: Monday, November 19, 2018 4:01 AM
To: ***@umconnect.umt.edu
Cc: r-sig-mixed-models <r-sig-mixed-***@r-project.org>
Subject: Re: [R-sig-ME] Single DV with multiple measures for time-varying IV?

Dear Ellen,

An extract of your dataset or a small dummy dataset coverting the important
features of your data would make it much easier to answer your questions.
And please don't send HTML emails. Any HTML formating gets stripped which
can make your email very hard to read.

Best regards,

ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
mailto:***@inbo.be
Havenlaan 88 bus 73, 1000 Brussel
http://www.inbo.be

///////////////////////////////////////////////////////////////////////////////////////////
To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
///////////////////////////////////////////////////////////////////////////////////////////

<https://www.inbo.be>


Op ma 12 nov. 2018 om 20:01 schreef Pero, Ellen <
mailto:***@umconnect.umt.edu>:

> Hi all:
>
> I have an analytical dilemma wherein I have a single DV with multiple
> categorical and continuous IVs (one of which is a continuous IV that has
> multiple measurements across time). I'm not sure the best way to model for
> this - though it's clearly a hierarchical situation so I thought this might
> be a good venue to pose the question.
>
> Specifically, I have 60 pregnant elk from which I took monthly cortisol
> samples across gestation (some missing values, so 5-8 samples/female across
> gestation). I'm interested in how those stress measurements across
> gestation (along with a range of other IVs that don't vary with time, e.g.,
> dam age, sire age, calf birthdate) influence the birth mass of each
> female's calf.
>
> Any suggestions on analysis for situations where a single DV is predicted
> by longitudinal measures of time-varying IV (along with non-varying IVs)?
>
> I'm new to this list and will spend some time familiarizing myself with it
> - but was eager to get my question out. Apologies if this isn't the right
> venue for my non-development related question. Please disregard if
> appropriate.
>
> I appreciate any thoughts/advice/suggestions!
> El
>
>
>
> Ellen Pero
> PhD Student
> Wildlife Biology Program
> W.A. Franke College of Forestry and Conservation
> University of Montana
> 32 Campus Drive, FOR 318
> Missoula, MT 59812
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> mailto:R-sig-mixed-***@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

[[alternative HTML version deleted]]

_______________________________________________
mailto:R-sig-mixed-***@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

Confidentiality Notice This message is sent from Zelis. ...{{dropped:13}}
Pero, Ellen
2018-11-21 15:28:58 UTC
Permalink
Thank you Bill and Thierry.


I don't yet have data in hand (cortisol samples await assay). However, this is what they will look like:

cortisol
---------------------------------
ID DV Month 1 Month 2 ... Month 8 dam age, sire age, calf birthdate
1 ....
2 ....
.. ....
60 ....

While I can simulate more data, my primary question is theoretical:

Is it acceptable practice to share a single dependent response (DV: here calf mass (kg)) amongst multiple time-varying nested independent predictors (here, monthly cortisol) as long as I place a random effect to signify the individual I am nesting on (ID).



ID DV cortisol, time, dam age, sire age, calf birthdate
1 17 35 Month 1 4 3 140
1 17 42 Month 2 4 3 140
........................................................
1 17 58 Month 8 4 3 140

2 19 30 Month 1 3 5 150
2 19 33 Month 2 3 5 150
........................................................
2 19 42 Month 7 3 5 150

........................................................

60 14 51 Month 2 2 2 162
60 14 58 Month 3 2 2 162
........................................................
60 14 70 Month 8 2 2 162

From my digging, I don't think it is good practice. So, for now, I am planning to average repeated cortisol samples within an individual to produce an 'early' and 'late' value, and include both as covariates within a glm.


I appreciate your support and encouragement!

El


Ellen Pero
PhD Student
Wildlife Biology Program
W.A. Franke College of Forestry and Conservation
University of Montana
32 Campus Drive, FOR 318
Missoula, MT 59812



________________________________
From: Bill Poling <***@zelis.com>
Sent: Monday, November 19, 2018 4:26 AM
To: Pero, Ellen
Cc: Thierry Onkelinx; r-sig-mixed-***@r-project.org; Bill Poling
Subject: RE: [R-sig-ME] Single DV with multiple measures for time-varying IV?

Hi Ellen.

If the data frame is not too terribly large, a dput() would be useful.
See ?dput()
Or a str() would help as well
See ?str()
However, as Thierry suggests a subset of your data would be most helpful.

I will be interested to follow this topic as I am teaching myself R and learning the various modeling methods and their purposes along the way.

I think you will gain considerable support from this list relevant to your topic.

Best regards.

WHP


From: R-sig-mixed-models <r-sig-mixed-models-***@r-project.org> On Behalf Of Thierry Onkelinx via R-sig-mixed-models
Sent: Monday, November 19, 2018 4:01 AM
To: ***@umconnect.umt.edu
Cc: r-sig-mixed-models <r-sig-mixed-***@r-project.org>
Subject: Re: [R-sig-ME] Single DV with multiple measures for time-varying IV?

Dear Ellen,

An extract of your dataset or a small dummy dataset coverting the important
features of your data would make it much easier to answer your questions.
And please don't send HTML emails. Any HTML formating gets stripped which
can make your email very hard to read.

Best regards,

ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
mailto:***@inbo.be
Havenlaan 88 bus 73, 1000 Brussel
http://www.inbo.be

///////////////////////////////////////////////////////////////////////////////////////////
To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
///////////////////////////////////////////////////////////////////////////////////////////

<https://www.inbo.be>


Op ma 12 nov. 2018 om 20:01 schreef Pero, Ellen <
mailto:***@umconnect.umt.edu>:

> Hi all:
>
> I have an analytical dilemma wherein I have a single DV with multiple
> categorical and continuous IVs (one of which is a continuous IV that has
> multiple measurements across time). I'm not sure the best way to model for
> this - though it's clearly a hierarchical situation so I thought this might
> be a good venue to pose the question.
>
> Specifically, I have 60 pregnant elk from which I took monthly cortisol
> samples across gestation (some missing values, so 5-8 samples/female across
> gestation). I'm interested in how those stress measurements across
> gestation (along with a range of other IVs that don't vary with time, e.g.,
> dam age, sire age, calf birthdate) influence the birth mass of each
> female's calf.
>
> Any suggestions on analysis for situations where a single DV is predicted
> by longitudinal measures of time-varying IV (along with non-varying IVs)?
>
> I'm new to this list and will spend some time familiarizing myself with it
> - but was eager to get my question out. Apologies if this isn't the right
> venue for my non-development related question. Please disregard if
> appropriate.
>
> I appreciate any thoughts/advice/suggestions!
> El
>
>
>
> Ellen Pero
> PhD Student
> Wildlife Biology Program
> W.A. Franke College of Forestry and Conservation
> University of Montana
> 32 Campus Drive, FOR 318
> Missoula, MT 59812
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> mailto:R-sig-mixed-***@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

[[alternative HTML version deleted]]

_______________________________________________
mailto:R-sig-mixed-***@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

Confidentiality Notice This message is sent from Zelis. ...{{dropped:16}}
Ben Bolker
2018-11-21 17:42:49 UTC
Permalink
Just for the record; I agree that it's almost definitely *not* going
to work to have identical responses for different predictor values.
Someone asked a similar question on StackOverflow recently:
https://stackoverflow.com/questions/53034261/warning-lme4-model-failed-to-converge-with-maxgrad

cheers
Ben Bolker

On 2018-11-21 10:28 a.m., Pero, Ellen wrote:
> Thank you Bill and Thierry.
>
>
> I don't yet have data in hand (cortisol samples await assay). However, this is what they will look like:
>
> cortisol
> ---------------------------------
> ID DV Month 1 Month 2 ... Month 8 dam age, sire age, calf birthdate
> 1 ....
> 2 ....
> .. ....
> 60 ....
>
> While I can simulate more data, my primary question is theoretical:
>
> Is it acceptable practice to share a single dependent response (DV: here calf mass (kg)) amongst multiple time-varying nested independent predictors (here, monthly cortisol) as long as I place a random effect to signify the individual I am nesting on (ID).
>
>
>
> ID DV cortisol, time, dam age, sire age, calf birthdate
> 1 17 35 Month 1 4 3 140
> 1 17 42 Month 2 4 3 140
> ........................................................
> 1 17 58 Month 8 4 3 140
>
> 2 19 30 Month 1 3 5 150
> 2 19 33 Month 2 3 5 150
> ........................................................
> 2 19 42 Month 7 3 5 150
>
> ........................................................
>
> 60 14 51 Month 2 2 2 162
> 60 14 58 Month 3 2 2 162
> ........................................................
> 60 14 70 Month 8 2 2 162
>
> From my digging, I don't think it is good practice. So, for now, I am planning to average repeated cortisol samples within an individual to produce an 'early' and 'late' value, and include both as covariates within a glm.
>
>
> I appreciate your support and encouragement!
>
> El
>
>
> Ellen Pero
> PhD Student
> Wildlife Biology Program
> W.A. Franke College of Forestry and Conservation
> University of Montana
> 32 Campus Drive, FOR 318
> Missoula, MT 59812
>
>
>
> ________________________________
> From: Bill Poling <***@zelis.com>
> Sent: Monday, November 19, 2018 4:26 AM
> To: Pero, Ellen
> Cc: Thierry Onkelinx; r-sig-mixed-***@r-project.org; Bill Poling
> Subject: RE: [R-sig-ME] Single DV with multiple measures for time-varying IV?
>
> Hi Ellen.
>
> If the data frame is not too terribly large, a dput() would be useful.
> See ?dput()
> Or a str() would help as well
> See ?str()
> However, as Thierry suggests a subset of your data would be most helpful.
>
> I will be interested to follow this topic as I am teaching myself R and learning the various modeling methods and their purposes along the way.
>
> I think you will gain considerable support from this list relevant to your topic.
>
> Best regards.
>
> WHP
>
>
> From: R-sig-mixed-models <r-sig-mixed-models-***@r-project.org> On Behalf Of Thierry Onkelinx via R-sig-mixed-models
> Sent: Monday, November 19, 2018 4:01 AM
> To: ***@umconnect.umt.edu
> Cc: r-sig-mixed-models <r-sig-mixed-***@r-project.org>
> Subject: Re: [R-sig-ME] Single DV with multiple measures for time-varying IV?
>
> Dear Ellen,
>
> An extract of your dataset or a small dummy dataset coverting the important
> features of your data would make it much easier to answer your questions.
> And please don't send HTML emails. Any HTML formating gets stripped which
> can make your email very hard to read.
>
> Best regards,
>
> ir. Thierry Onkelinx
> Statisticus / Statistician
>
> Vlaamse Overheid / Government of Flanders
> INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
> FOREST
> Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
> mailto:***@inbo.be
> Havenlaan 88 bus 73, 1000 Brussel
> http://www.inbo.be
>
> ///////////////////////////////////////////////////////////////////////////////////////////
> To call in the statistician after the experiment is done may be no more
> than asking him to perform a post-mortem examination: he may be able to say
> what the experiment died of. ~ Sir Ronald Aylmer Fisher
> The plural of anecdote is not data. ~ Roger Brinner
> The combination of some data and an aching desire for an answer does not
> ensure that a reasonable answer can be extracted from a given body of data.
> ~ John Tukey
> ///////////////////////////////////////////////////////////////////////////////////////////
>
> <https://www.inbo.be>
>
>
> Op ma 12 nov. 2018 om 20:01 schreef Pero, Ellen <
> mailto:***@umconnect.umt.edu>:
>
>> Hi all:
>>
>> I have an analytical dilemma wherein I have a single DV with multiple
>> categorical and continuous IVs (one of which is a continuous IV that has
>> multiple measurements across time). I'm not sure the best way to model for
>> this - though it's clearly a hierarchical situation so I thought this might
>> be a good venue to pose the question.
>>
>> Specifically, I have 60 pregnant elk from which I took monthly cortisol
>> samples across gestation (some missing values, so 5-8 samples/female across
>> gestation). I'm interested in how those stress measurements across
>> gestation (along with a range of other IVs that don't vary with time, e.g.,
>> dam age, sire age, calf birthdate) influence the birth mass of each
>> female's calf.
>>
>> Any suggestions on analysis for situations where a single DV is predicted
>> by longitudinal measures of time-varying IV (along with non-varying IVs)?
>>
>> I'm new to this list and will spend some time familiarizing myself with it
>> - but was eager to get my question out. Apologies if this isn't the right
>> venue for my non-development related question. Please disregard if
>> appropriate.
>>
>> I appreciate any thoughts/advice/suggestions!
>> El
>>
>>
>>
>> Ellen Pero
>> PhD Student
>> Wildlife Biology Program
>> W.A. Franke College of Forestry and Conservation
>> University of Montana
>> 32 Campus Drive, FOR 318
>> Missoula, MT 59812
>>
>>
>> [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> mailto:R-sig-mixed-***@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> mailto:R-sig-mixed-***@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
> Confidentiality Notice This message is sent from Zelis. ...{{dropped:16}}
>
> _______________________________________________
> R-sig-mixed-***@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
Loading...