runehaubo / lmerTestR

Repository for the R-package lmerTest
48 stars 9 forks source link

Elimination of significant factore using Step Function #27

Closed ronysym closed 4 years ago

ronysym commented 4 years ago

Dear Rune

I hope you are fine.

I have tried the last update of lmerTest with several datasets but I had the same problem several times, and no allways. When I use the step function, some significant factors did not appear in the results even if the final model contained the factor. See below.

Did I do something wrong ?

Best regards

Ronan SYMONEAUX

##########

Script used

Anasenso<- read.table ("Anova2.txt", header=T) res.base <- lmer(formula=sucre~date+(1|juge2)+produit+date:produit, data=Anasenso) res.step <- step(res.base, reduce.fixed=FALSE, reduce.random=FALSE)

##########

Results

res.step Backward reduced random-effect table:

        Eliminated npar  logLik    AIC    LRT Df Pr(>Chisq)    
22 -667.34 1378.7 (1 | juge2) 0 21 -695.64 1433.3 56.601 1 5.34e-14 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Backward reduced fixed-effect table: Degrees of freedom method: Satterthwaite Eliminated Sum Sq Mean Sq NumDF DenDF F value Pr(>F) date:produit 0 67.839 5.6532 12 284 3.4107 0.0001094 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Model found: sucre ~ date + (1 | juge2) + produit + date:produit [ANOVA2.txt](https://github.com/runehaubo/lmerTestR/files/3578513/ANOVA2.txt)
runehaubo commented 4 years ago

Did you expect to see the tests of the fixed main effects? The step function respects the marginality of the model terms and will not test main effects if these are part of significant interactions. (Internally it uses drop1 rather than anova)

Cheers Rune

tor. 5. sep. 2019 kl. 11.32 skrev ronysym notifications@github.com:

Dear Rune

I hope you are fine.

I have tried the last update of lmerTest with several datasets but I had the same problem several times, and no allways. When I use the step function, some significant factors did not appear in the results even if the final model contained the factor. See below.

Did I do something wrong ?

Best regards

Ronan SYMONEAUX

##########

Script used

Anasenso<- read.table ("Anova2.txt", header=T) res.base <- lmer(formula=sucre~date+(1|juge2)+produit+date:produit, data=Anasenso) res.step <- step(res.base, reduce.fixed=FALSE, reduce.random=FALSE)

##########

Results

res.step Backward reduced random-effect table:

    Eliminated npar  logLik    AIC    LRT Df Pr(>Chisq)

22 -667.34 1378.7 (1 | juge2) 0 21 -695.64 1433.3 56.601 1 5.34e-14 ***

Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Backward reduced fixed-effect table: Degrees of freedom method: Satterthwaite

     Eliminated Sum Sq Mean Sq NumDF DenDF F value    Pr(>F)

date:produit 0 67.839 5.6532 12 284 3.4107 0.0001094 ***

Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Model found: sucre ~ date + (1 | juge2) + produit + date:produit

ANOVA2.txt https://github.com/runehaubo/lmerTestR/files/3578513/ANOVA2.txt

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/runehaubo/lmerTestR/issues/27?email_source=notifications&email_token=ABHZZLJNXFXDQGMFTBMUAQ3QIDGZ3A5CNFSM4IT3S7JKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HJPJMVQ, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHZZLJOODQL22ZLDUAZDB3QIDGZ3ANCNFSM4IT3S7JA .

ronysym commented 4 years ago

Dear Rune

Thank you for your answer.

Yes, I expect to access all the pvalue for the fixed main effect and interaction. In the previous version of LmerTest, after Step, we had the pvalue for all of that. It was interesting because when we have to report the Anova Table in a paper , all pvalues are expected. Do you have any proposal to obtain these ?

Best regards

Ronan SYMONEAUX (HDR) Chargé de Recherche et Valorisation en Evaluation Sensorielle et Sciences du Consommateur Tel : + 33 (0) 2.41.23.56.05 Port : + 33 (0) 6.47.19.26.17[cid:image004.jpg@01D564BD.6229A2B0]

De : Rune Haubo B Christensen notifications@github.com Envoyé : vendredi 6 septembre 2019 10:40 À : runehaubo/lmerTestR lmerTestR@noreply.github.com Cc : SYMONEAUX Ronan r.symoneaux@groupe-esa.com; Author author@noreply.github.com Objet : Re: [runehaubo/lmerTestR] Elimination of significant factore using Step Function (#27)

Did you expect to see the tests of the fixed main effects? The step function respects the marginality of the model terms and will not test main effects if these are part of significant interactions. (Internally it uses drop1 rather than anova)

Cheers Rune

tor. 5. sep. 2019 kl. 11.32 skrev ronysym notifications@github.com:

Dear Rune

I hope you are fine.

I have tried the last update of lmerTest with several datasets but I had the same problem several times, and no allways. When I use the step function, some significant factors did not appear in the results even if the final model contained the factor. See below.

Did I do something wrong ?

Best regards

Ronan SYMONEAUX

##########

Script used

Anasenso<- read.table ("Anova2.txt", header=T) res.base <- lmer(formula=sucre~date+(1|juge2)+produit+date:produit, data=Anasenso) res.step <- step(res.base, reduce.fixed=FALSE, reduce.random=FALSE)

##########

Results

res.step Backward reduced random-effect table:

Eliminated npar logLik AIC LRT Df Pr(>Chisq)

22 -667.34 1378.7 (1 | juge2) 0 21 -695.64 1433.3 56.601 1 5.34e-14 ***

Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Backward reduced fixed-effect table: Degrees of freedom method: Satterthwaite

Eliminated Sum Sq Mean Sq NumDF DenDF F value Pr(>F)

date:produit 0 67.839 5.6532 12 284 3.4107 0.0001094 ***

Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Model found: sucre ~ date + (1 | juge2) + produit + date:produit

ANOVA2.txt https://github.com/runehaubo/lmerTestR/files/3578513/ANOVA2.txt

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/runehaubo/lmerTestR/issues/27?email_source=notifications&email_token=ABHZZLJNXFXDQGMFTBMUAQ3QIDGZ3A5CNFSM4IT3S7JKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HJPJMVQ, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHZZLJOODQL22ZLDUAZDB3QIDGZ3ANCNFSM4IT3S7JA .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/runehaubo/lmerTestR/issues/27?email_source=notifications&email_token=ANDEEQGNCBMBQBGZTP64O33QIIJMRA5CNFSM4IT3S7JKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6CFSLQ#issuecomment-528767278, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ANDEEQB4AZOMO4SX47M2CU3QIIJMRANCNFSM4IT3S7JA.

runehaubo commented 4 years ago

You just run anova on the final model - see the examples in ?step for how to achieve this. This also lets you choose which type of anova table you would like.

Cheers Rune

lør. 7. sep. 2019 kl. 01.57 skrev ronysym notifications@github.com:

Dear Rune

Thank you for your answer.

Yes, I expect to access all the pvalue for the fixed main effect and interaction. In the previous version of LmerTest, after Step, we had the pvalue for all of that. It was interesting because when we have to report the Anova Table in a paper , all pvalues are expected. Do you have any proposal to obtain these ?

Best regards

Ronan SYMONEAUX (HDR) Chargé de Recherche et Valorisation en Evaluation Sensorielle et Sciences du Consommateur Tel : + 33 (0) 2.41.23.56.05 Port : + 33 (0) 6.47.19.26.17[cid:image004.jpg@01D564BD.6229A2B0]

De : Rune Haubo B Christensen notifications@github.com Envoyé : vendredi 6 septembre 2019 10:40 À : runehaubo/lmerTestR lmerTestR@noreply.github.com Cc : SYMONEAUX Ronan r.symoneaux@groupe-esa.com; Author < author@noreply.github.com> Objet : Re: [runehaubo/lmerTestR] Elimination of significant factore using Step Function (#27)

Did you expect to see the tests of the fixed main effects? The step function respects the marginality of the model terms and will not test main effects if these are part of significant interactions. (Internally it uses drop1 rather than anova)

Cheers Rune

tor. 5. sep. 2019 kl. 11.32 skrev ronysym notifications@github.com:

Dear Rune

I hope you are fine.

I have tried the last update of lmerTest with several datasets but I had the same problem several times, and no allways. When I use the step function, some significant factors did not appear in the results even if the final model contained the factor. See below.

Did I do something wrong ?

Best regards

Ronan SYMONEAUX

##########

Script used

Anasenso<- read.table ("Anova2.txt", header=T) res.base <- lmer(formula=sucre~date+(1|juge2)+produit+date:produit, data=Anasenso) res.step <- step(res.base, reduce.fixed=FALSE, reduce.random=FALSE)

##########

Results

res.step Backward reduced random-effect table:

Eliminated npar logLik AIC LRT Df Pr(>Chisq)

22 -667.34 1378.7 (1 | juge2) 0 21 -695.64 1433.3 56.601 1 5.34e-14 ***

Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Backward reduced fixed-effect table: Degrees of freedom method: Satterthwaite

Eliminated Sum Sq Mean Sq NumDF DenDF F value Pr(>F)

date:produit 0 67.839 5.6532 12 284 3.4107 0.0001094 ***

Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Model found: sucre ~ date + (1 | juge2) + produit + date:produit

ANOVA2.txt https://github.com/runehaubo/lmerTestR/files/3578513/ANOVA2.txt

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/runehaubo/lmerTestR/issues/27?email_source=notifications&email_token=ABHZZLJNXFXDQGMFTBMUAQ3QIDGZ3A5CNFSM4IT3S7JKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HJPJMVQ>,

or mute the thread < https://github.com/notifications/unsubscribe-auth/ABHZZLJOODQL22ZLDUAZDB3QIDGZ3ANCNFSM4IT3S7JA>

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub< https://github.com/runehaubo/lmerTestR/issues/27?email_source=notifications&email_token=ANDEEQGNCBMBQBGZTP64O33QIIJMRA5CNFSM4IT3S7JKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6CFSLQ#issuecomment-528767278>, or mute the thread< https://github.com/notifications/unsubscribe-auth/ANDEEQB4AZOMO4SX47M2CU3QIIJMRANCNFSM4IT3S7JA>.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/runehaubo/lmerTestR/issues/27?email_source=notifications&email_token=ABHZZLLWMBMLNORSNXQISN3QILU5RA5CNFSM4IT3S7JKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6EKTJQ#issuecomment-529050022, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHZZLIQP2IMFKOPRHBIPTTQILU5RANCNFSM4IT3S7JA .

ronysym commented 4 years ago

It’s perfect like this.

Thank you for your answers

Ronan SYMONEAUX (HDR) Chargé de Recherche et Valorisation en Evaluation Sensorielle et Sciences du Consommateur Tel : + 33 (0) 2.41.23.56.05 Port : + 33 (0) 6.47.19.26.17[cid:image004.jpg@01D5743E.2814BDE0]

De : Rune Haubo B Christensen notifications@github.com Envoyé : samedi 7 septembre 2019 09:33 À : runehaubo/lmerTestR lmerTestR@noreply.github.com Cc : SYMONEAUX Ronan r.symoneaux@groupe-esa.com; Author author@noreply.github.com Objet : Re: [runehaubo/lmerTestR] Elimination of significant factore using Step Function (#27)

You just run anova on the final model - see the examples in ?step for how to achieve this. This also lets you choose which type of anova table you would like.

Cheers Rune

lør. 7. sep. 2019 kl. 01.57 skrev ronysym notifications@github.com:

Dear Rune

Thank you for your answer.

Yes, I expect to access all the pvalue for the fixed main effect and interaction. In the previous version of LmerTest, after Step, we had the pvalue for all of that. It was interesting because when we have to report the Anova Table in a paper , all pvalues are expected. Do you have any proposal to obtain these ?

Best regards

Ronan SYMONEAUX (HDR) Chargé de Recherche et Valorisation en Evaluation Sensorielle et Sciences du Consommateur Tel : + 33 (0) 2.41.23.56.05 Port : + 33 (0) 6.47.19.26.17[cid:image004.jpg@01D564BD.6229A2B0]

De : Rune Haubo B Christensen notifications@github.com Envoyé : vendredi 6 septembre 2019 10:40 À : runehaubo/lmerTestR lmerTestR@noreply.github.com Cc : SYMONEAUX Ronan r.symoneaux@groupe-esa.com; Author < author@noreply.github.com> Objet : Re: [runehaubo/lmerTestR] Elimination of significant factore using Step Function (#27)

Did you expect to see the tests of the fixed main effects? The step function respects the marginality of the model terms and will not test main effects if these are part of significant interactions. (Internally it uses drop1 rather than anova)

Cheers Rune

tor. 5. sep. 2019 kl. 11.32 skrev ronysym notifications@github.com:

Dear Rune

I hope you are fine.

I have tried the last update of lmerTest with several datasets but I had the same problem several times, and no allways. When I use the step function, some significant factors did not appear in the results even if the final model contained the factor. See below.

Did I do something wrong ?

Best regards

Ronan SYMONEAUX

##########

Script used

Anasenso<- read.table ("Anova2.txt", header=T) res.base <- lmer(formula=sucre~date+(1|juge2)+produit+date:produit, data=Anasenso) res.step <- step(res.base, reduce.fixed=FALSE, reduce.random=FALSE)

##########

Results

res.step Backward reduced random-effect table:

Eliminated npar logLik AIC LRT Df Pr(>Chisq)

22 -667.34 1378.7 (1 | juge2) 0 21 -695.64 1433.3 56.601 1 5.34e-14 ***

Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Backward reduced fixed-effect table: Degrees of freedom method: Satterthwaite

Eliminated Sum Sq Mean Sq NumDF DenDF F value Pr(>F)

date:produit 0 67.839 5.6532 12 284 3.4107 0.0001094 ***

Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Model found: sucre ~ date + (1 | juge2) + produit + date:produit

ANOVA2.txt https://github.com/runehaubo/lmerTestR/files/3578513/ANOVA2.txt

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/runehaubo/lmerTestR/issues/27?email_source=notifications&email_token=ABHZZLJNXFXDQGMFTBMUAQ3QIDGZ3A5CNFSM4IT3S7JKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HJPJMVQ>,

or mute the thread < https://github.com/notifications/unsubscribe-auth/ABHZZLJOODQL22ZLDUAZDB3QIDGZ3ANCNFSM4IT3S7JA>

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub< https://github.com/runehaubo/lmerTestR/issues/27?email_source=notifications&email_token=ANDEEQGNCBMBQBGZTP64O33QIIJMRA5CNFSM4IT3S7JKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6CFSLQ#issuecomment-528767278>, or mute the thread< https://github.com/notifications/unsubscribe-auth/ANDEEQB4AZOMO4SX47M2CU3QIIJMRANCNFSM4IT3S7JA>.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/runehaubo/lmerTestR/issues/27?email_source=notifications&email_token=ABHZZLLWMBMLNORSNXQISN3QILU5RA5CNFSM4IT3S7JKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6EKTJQ#issuecomment-529050022, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHZZLIQP2IMFKOPRHBIPTTQILU5RANCNFSM4IT3S7JA .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/runehaubo/lmerTestR/issues/27?email_source=notifications&email_token=ANDEEQDC7NDB2URYHKCWBVDQINKJ5A5CNFSM4IT3S7JKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6ESS5I#issuecomment-529082741, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ANDEEQEWJ5B3FUETTBML2Z3QINKJ5ANCNFSM4IT3S7JA.