[R-sig-ME] Help with a multiresponse model
Voeten, C.C.
c@c@voeten @end|ng |rom hum@|e|denun|v@n|
Wed Mar 20 14:09:52 CET 2019
Hi Matteo,
Ah, I see. I had missed that each of your larvae would be a single column of observations. I thought you had multiple dependent measures (e.g. 'ct_day1', 'ct_day2', 'ct_day3') and wanted to fit a multi-response model to those, with larvae as rows.
Would it work if you transformed your data into long format, so that larvae become rows instead of columns and you get an additional column 'larva'? In that case, you could just run something like gam(ct ~ s(WDS) + cros4 + s(larva,bs='re')) (possibly also including random slopes for larva and factor smooths for WDS by larva, and possibly also including a factor for measurement day). That wouldn't be a multi-response model anymore, but from what you've shown it seems to me that this is actually closer to what you want?
Best,
Cesko
Van: Matteo Redana <matteo.redana using hotmail.com>
Verzonden: woensdag 20 maart 2019 12:29
Aan: Voeten, C.C. <c.c.voeten using hum.leidenuniv.nl>; 'r-sig-mixed-models using r-project.org' <r-sig-mixed-models using r-project.org>
Onderwerp: RE: Help with a multiresponse model
Dear Cesko,
Do you suggest this approach? (see attached table with a subset of three larvae ct1,ct2 and ct3)
new<-gam(list(ct1~s(WDS,k=3)+cros4,ct2~s(WDS,k=3)+cros4,ct3~s(WDS,k=3)+cros4),data=linrathen,method="REML",family = mvn(d=3))
where WDS is temperature of water, cros4 is a crossbasis object to look at the lagged effect (lag=240, means 10 days)
I have these problems:
I have each sampling days ca. 30 larvae: means that mvn(d=30)?
Given that in the three different sampling days the individuals are different I am assuming that in the same column the individual is the same.
I hope to be clear, if you need other info just ask.
Many Thanks
Matteo
Sent from https://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10
________________________________________
From: Voeten, C.C. <mailto:c.c.voeten using hum.leidenuniv.nl>
Sent: Wednesday, March 20, 2019 10:55:19 AM
To: 'Matteo Redana'; 'r-sig-mixed-models using r-project.org'
Subject: RE: Help with a multiresponse model
Dear Matteo,
Since you are using GAMs anyway, have you considered using gam() with family='mvn(2)'?
Best,
Cesko
-----Oorspronkelijk bericht-----
Van: R-sig-mixed-models <mailto:r-sig-mixed-models-bounces using r-project.org> Namens Matteo Redana
Verzonden: woensdag 20 maart 2019 07:42
Aan: mailto:r-sig-mixed-models using r-project.org
Onderwerp: [R-sig-ME] Help with a multiresponse model
Dear all,
I�m new in the mailing list. I�m coning to you for a problem on how approach my data:
I have a time series of Water temperature from 06-06-2017 to 28-07-2017, 1 value each hour. In the same period the 10\06, 02/07 and 25/07 were sampled larvae from the river and teste for thermotolerance. So each sampling day I have a different number of larvae with different thermotolerances. Working with GAM there are evidence of a trend in thermotolrence, given the high variability in each sample day.
What I want to do is to create a model that look at the impact of water temperature (also lagged values) on the thermotolerance.
Until now I�ve ever worked with mgcv and dlnm package in hydraulics, but it�s the first time with this kind of data.
I don�t know how to build a model, given that I have water temp. value in a different scale (hourly) and a multiple response in my Y (CT-thermotolerance).
The next step will be to preform a mixed model to test differences in natural site and artificial (this experiment was done in different lake).
Any suggestion is welcome!
Matteo
Sent from Mail<https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D550986&data=02%7C01%7C%7C5eadbc71ac274ccf2d3d08d6ad1a2b79%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636886725238016932&sdata=u44KZixs648dMNQx6%2FDIJC4sUGOmn0rGsnY%2Bws4ekx8%3D&reserved=0> for Windows 10
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list