I'm wondering if a treatment has an effect on my mite population. Therefore I've got a dataset with repeated measurements, some data is missing.
data:
ID Treatment Mites Time Location StartPopulation X1bib
ID1 Control 7 t1 Loc1 5 10000
ID1 Control 8 t2 Loc1 5 10000
ID1 Control 10 t3 Loc1 5 10000
ID1 Control 11 t7 Loc1 5 10000
ID2 Control 12 t1 Loc2 11 13000
ID2 Control t2 Loc2 11 13000
ID2 Control 14 t3 Loc2 11 13000
ID3 Treatment 20 t1 Loc1 20 12000
ID3 Treatment 22 t2 Loc1 20 12000
ID3 Treatment t3 Loc1 20 12000
ID4 Treatment 20 t1 Loc11 18 11500
and so on..
totally: 110 IDs; 7 different measurements (Time)
variables:
ID: factor, unique ID for each population
Treatment: factor ("Treatment" or "Control")
Mites: numeric, the variable I'm interested in
Time: factor with total 7 levels
Location: factor with total 11 levels
StartPopulation: numeric (mean of Mites for t=-3, -2, -1 -> before Treatment started)
X1bib: numeric
I'm interested if my Treatment
changed the Mites
count - and if yes if there's an increase in it's effect over time. StartPopulation
sure had an influence on Mites
, otherFactor
and Location
could've had also.
As I use a mixed model I'd like to use glmer
in R
. My syntax looks like this:
(changed it, thank you for your answers so far)
PPP <- glmer(Mites ~ Treatment * Time + StartPopulation + X1bib + (1|ID) + (1|Location), data=vat_database, family=poisson)
which outputs:
Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod']
Family: poisson ( log )
Formula: Mites ~ Treatment * Time + StartPopulation + X1bib + (1 | ID) + (1 | Location)
Data: vat_database
AIC BIC logLik deviance df.resid
Inf Inf -Inf Inf 349
Random effects:
Groups Name Std.Dev.
ID (Intercept) 1
Location (Intercept) 1
Number of obs: 367, groups: ID, 78; Location, 9
Fixed Effects:
(Intercept) TreatmentTreatment Timevmf_A2 Timevmf_A3 Timevmf_K1 Timevmf_K2
2.418e-01 5.342e-01 3.252e-01 5.389e-01 5.725e-01 1.102e+00
Timevmf_K3 Timevmf_K4 StartPopulation X1bib TreatmentTreatment:Timevmf_A2 TreatmentTreatment:Timevmf_A3
1.079e+00 7.893e-01 1.486e-01 -1.331e-06 -4.664e-01 -5.453e-01
TreatmentTreatment:Timevmf_K1 TreatmentTreatment:Timevmf_K2 TreatmentTreatment:Timevmf_K3 TreatmentTreatment:Timevmf_K4
-4.513e-01 -5.476e-01 -4.477e-01 -6.858e-01
fit warnings:
Some predictor variables are on very different scales: consider rescaling
convergence code 0; 1 optimizer warnings; 81500 lme4 warnings
Am I right considering that on Time="vmf_K1"
my Treatment
Mite Population was -4.513e-01 smaller than my Control
Mite Population? How about significances?
glmer(, family=poisson)
instead oflmer()
, for a start. $\endgroup$