Skip to main content
Add formula, add output
Source Link
ID   Treatment    Mites   Time    Location    StartPopulation    otherFactorX1bib
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)
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)
otherFactorX1bib:           numeric

As I use a mixed model I'd like to use lmerglmer in R. My syntax looks like this: (changed it, thank you for your answers so far)

PPP <- lmerglmer(Mites ~ Treatment * Time + StartPopulation + LocationX1bib + otherFactor(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|Time1 | ID) +      (1|ID1 | 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, data=vat_databasegroups:  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

But as I don't really know whatAm I typed exactly I'm glad if you can help me understanding how this worksright considering that on Time="vmf_K1" my Treatment Mite Population was -4.513e-01 smaller than my Control Mite Population? How about significances?

ID   Treatment    Mites   Time   Location    StartPopulation    otherFactor
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)
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)
otherFactor:     numeric

As I use a mixed model I'd like to use lmer in R. My syntax looks like this:

PPP <- lmer(Mites ~ Treatment + StartPopulation + Location + otherFactor + 
                    (1|Time) + (1|ID), data=vat_database)

But as I don't really know what I typed exactly I'm glad if you can help me understanding how this works.

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)
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

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?

data set change
Source Link
ID   Treatment    Mites   Time   Location    StartPopulation    otherFactor
ID1  Control      7       1t1      Loc1        5                  10000
ID1  Control      8       2t2      Loc1        5                  10000
ID1  Control      10      3t3      Loc1        5                  10000
ID1  Control      11      t7      Loc1        5                  10000
ID2  Control      12      1t1      Loc2        11                 13000
ID2  Control              2t2      Loc2        11                 13000
ID2  Control      14      3t3      Loc2        11                 13000
ID3  Treatment    20      1t1      Loc1        20                 12000
ID3  Treatment    22      2t2      Loc1        20                 12000
ID3  Treatment            3t3      Loc1        20                 12000
ID4  Treatment    20      t1      Loc11       18                 11500
and so on..
totally: 110 IDs; 7 different measurementmeasurements Timestamps(Time)
ID   Treatment    Mites   Time   Location    StartPopulation    otherFactor
ID1  Control      7       1      Loc1        5                  10000
ID1  Control      8       2      Loc1        5                  10000
ID1  Control      10      3      Loc1        5                  10000
ID2  Control      12      1      Loc2        11                 13000
ID2  Control              2      Loc2        11                 13000
ID2  Control      14      3      Loc2        11                 13000
ID3  Treatment    20      1      Loc1        20                 12000
ID3  Treatment    22      2      Loc1        20                 12000
ID3  Treatment            3      Loc1        20                 12000
and so on..
totally: 110 IDs; 7 different measurement Timestamps
ID   Treatment    Mites   Time   Location    StartPopulation    otherFactor
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)
formatted; light editing; removed thanks
Source Link
gung - Reinstate Monica
  • 147.5k
  • 89
  • 406
  • 717

data:
 


ID   Treatment    Mites   Time   Location    StartPopulation    otherFactor
ID1  Control      7       1      Loc1        5                  10000
ID1  Control      8       2      Loc1        5                  10000
ID1  Control      10      3      Loc1        5                  10000
ID2  Control      12      1      Loc2        11                 13000
ID2  Control              2      Loc2        11                 13000
ID2  Control      14      3      Loc2        11                 13000
ID3  Treatment    20      1      Loc1        20                 12000
ID3  Treatment    22      2      Loc1        20                 12000
ID3  Treatment            3      Loc1        20                 12000
and so on..
totally: 110IDs; 7 different measurement Timestamps
ID   Treatment    Mites   Time   Location    StartPopulation    otherFactor
ID1  Control      7       1      Loc1        5                  10000
ID1  Control      8       2      Loc1        5                  10000
ID1  Control      10      3      Loc1        5                  10000
ID2  Control      12      1      Loc2        11                 13000
ID2  Control              2      Loc2        11                 13000
ID2  Control      14      3      Loc2        11                 13000
ID3  Treatment    20      1      Loc1        20                 12000
ID3  Treatment    22      2      Loc1        20                 12000
ID3  Treatment            3      Loc1        20                 12000
and so on..
totally: 110 IDs; 7 different measurement Timestamps

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)
otherFactor:     numeric
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)
otherFactor:     numeric

I'm interested if my TreatmentTreatment changed the MitesMites count - and if yes if there's an increase in it's effect over time. StartPopulationStartPopulation sure had an influence on MitesMites, otherFactorotherFactor and LocationLocation could've had also.

As I use a mixed model I'd like to use lmer in Rlmer in R. My syntax looks anything like thatthis: PPP <- lmer(Mites ~ Treatment + StartPopulation + Location + otherFactor + (1|Time) + (1|ID), data=vat_database) But

PPP <- lmer(Mites ~ Treatment + StartPopulation + Location + otherFactor + 
                    (1|Time) + (1|ID), data=vat_database)

But as I don't really know what I typed exactly I'm glad if you can help me understanding how this works.

Thank you so much, kind regards

data:
 


ID   Treatment    Mites   Time   Location    StartPopulation    otherFactor
ID1  Control      7       1      Loc1        5                  10000
ID1  Control      8       2      Loc1        5                  10000
ID1  Control      10      3      Loc1        5                  10000
ID2  Control      12      1      Loc2        11                 13000
ID2  Control              2      Loc2        11                 13000
ID2  Control      14      3      Loc2        11                 13000
ID3  Treatment    20      1      Loc1        20                 12000
ID3  Treatment    22      2      Loc1        20                 12000
ID3  Treatment            3      Loc1        20                 12000
and so on..
totally: 110IDs; 7 different measurement Timestamps

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)
otherFactor:     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 lmer in R. My syntax looks anything like that: PPP <- lmer(Mites ~ Treatment + StartPopulation + Location + otherFactor + (1|Time) + (1|ID), data=vat_database) But as I don't really know what I typed exactly I'm glad if you can help me understanding how this works.

Thank you so much, kind regards

data:

ID   Treatment    Mites   Time   Location    StartPopulation    otherFactor
ID1  Control      7       1      Loc1        5                  10000
ID1  Control      8       2      Loc1        5                  10000
ID1  Control      10      3      Loc1        5                  10000
ID2  Control      12      1      Loc2        11                 13000
ID2  Control              2      Loc2        11                 13000
ID2  Control      14      3      Loc2        11                 13000
ID3  Treatment    20      1      Loc1        20                 12000
ID3  Treatment    22      2      Loc1        20                 12000
ID3  Treatment            3      Loc1        20                 12000
and so on..
totally: 110 IDs; 7 different measurement Timestamps
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)
otherFactor:     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 lmer in R. My syntax looks like this:

PPP <- lmer(Mites ~ Treatment + StartPopulation + Location + otherFactor + 
                    (1|Time) + (1|ID), data=vat_database)

But as I don't really know what I typed exactly I'm glad if you can help me understanding how this works.

Source Link
Loading