anova - P-value Troubles in R -


i have question regarding p-values. i've been comparing different linear models determine if 1 model better following function in r.

 anova(model1,model2) 

unfortunately, not calculate f or p-value. here example of anova summary did not give p-value

 analysis of variance table   model 1: influence ~ sortedsums[, combos2[1, a]] + sortedsums[, combos2[2,a]]  model 2: influence ~ sortedsums[, b]     res.df   rss df sum of sq f pr(>f)  1    127 3090.9                        2    128 2655.2 -1    435.74  

for sake of symmetry, here anova summary did yield p-value.

 analysis of variance table   model 1: influence ~ sortedsums[, combos2[1, a]] + sortedsums[, combos2[2,a]]  model 2: influence ~ sortedsums[, b]     res.df    rss df sum of sq      f pr(>f)   1    127 3090.9                              2    128 3157.6 -1   -66.652 2.7386 0.1004 

do know why occurs?

not questions require code examples. don't deserve snarked @ being new, , i'm sorry people did. here answer:

the difference between 2 models not significant.

here can it:

  • check make sure terms of 1 model object superset of terms of other. otherwise, default anova test invalid begin (you instead compare such non-nested models using aic, belongs in separate question). i'm curious see nested pair of models manages that non-significant, again, it's not necessary answering question.
  • if checked, , models nested, , analysis doing manually, write p=1.0 in report , call day.
  • if models nested, , above feels cheating, here's how th hard way. asking anova whether 1 variable differ makes significant contribution fit. take "larger" model , summary(bar). p-value corresponding variable present in bar missing in foo p-value! , it's equal 1. , square of t-statistic f-value.
  • if models nested , analysis doing programmatically , absence of p-value breaks stuff elsewhere in script, anova(foo,bar)[,5:6] nas instead of blanks... again, if doing programmatically have tried that.

good luck!


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -