ElMaestro ★★★ Denmark, 2019-01-07 15:52 (2269 d 01:09 ago) Posting: # 19744 Views: 5,582 |
|
Hi all, happy new year. I am exploring the confint function in R and the oppotunities for multiplicity adjustment. In fact, the confint function allows an adjust argument :In my current models I can apply adjust= e.g. "bonferroni" , "none" , "sidak" , "mvt" and "tukey" (which is the default). I cannot, however, find any documentation which tells me what the options really are; the ones above are only the options I found by googling, and finding pages like this one. ??adjust gets me nowhere in practice.I emphasize that adjust under confint is not the same as p.adjust which is documented here, but naïvely I thought the arguments would be the same. If I specify adjust="holm" or adjust="hochberg" it defaults to Bonferroni in models I am looking at, so either these methods are not implemented for confint or they achieve the same in my models, not sure. If I do adjust="eat.my.shorts" etc then I don't get an error but just bonferroni ![]() Note that the adjust argument is one of the "..."'s so isn't part of the function documentation. It must be mapped out somewhere??? So... Can anyone point me to some online documentation which tells which options the adjust argument allows? Or can any tell me how how I could systematically look up this type of question generally?— Pass or fail! ElMaestro |
d_labes ★★★ Berlin, Germany, 2019-01-07 18:02 (2268 d 22:59 ago) @ ElMaestro Posting: # 19749 Views: 4,802 |
|
Dear ElMaestro, ❝ I am exploring the ❝ In fact, the ❝ ❝ In my current models I can apply Sorry, but AFAIK the default confint method or that for lm() objects has no adjust argument, or more precisely spoken accepts any string for adjust= but without any effect. Example:> fit <- lm(100/mpg ~ disp + hp + wt + am, data = mtcars) There is no error thrown because confint() has an ... argument, for which there is no error check available. What you describe must be an effect of using an add-on package with comes with the possibility to consider multiplicity in calculation of confidence intervals. If you are lucky, the documentation of that package will contain details of what the adjust= argument will do. Look into the ./doc sub-directory of the package and look for vignettes or other documentation material.But here I must say that being lucky is not so often the case ![]() confint.class() function, where class is the model class, defined in the package you uses.— Regards, Detlew |
ElMaestro ★★★ Denmark, 2019-01-07 19:12 (2268 d 21:49 ago) @ d_labes Posting: # 19754 Views: 4,813 |
|
Dear d_labes, ❝ What you describe must be an effect of using an add-on package with comes with the possibility to consider multiplicity in calculation of confidence intervals. Thanks a lot for commenting ![]() Can you try this:
library("lsmeans") It gives four different results here. You can see adjust is passed as an argument to the confint function so can't see how it would be part of lsmeans or pairs args.— Pass or fail! ElMaestro |
d_labes ★★★ Berlin, Germany, 2019-01-07 20:19 (2268 d 20:42 ago) @ ElMaestro Posting: # 19756 Views: 4,785 |
|
Dear Anders! ❝ ❝ library("lsmeans") adjust= is an argument only available with package lsmeans (or another package overriding the behavior of confint() for other classes then "lm".❝ ... ❝ confint(pairs(lsmeans(M, "Foo")), adjust="none") ❝ confint(pairs(lsmeans(M, "Foo")), adjust="bonferroni") ❝ confint(pairs(lsmeans(M, "Foo")), adjust="eat.my.shorts") ❝ confint(pairs(lsmeans(M, "Foo"))) ❝ # HAPPY NEW YEAR [/code] ❝ ❝ It gives four different results here. You can see Correct concerning four different results. adjust="eat.my.shorts" is outstanding because this "method" isn't implemented but transferred via "..." and thus doesn't underlay any error checks. To react on this undesirable feature the programmer decided to set adjust= in such cases to adjust="bonferroni" . Reasonable. Or?This behavior is described in the man page of lsmeans/pairs or summary.emmGrid. But adjust= is part of package lsmeans. Reason: class(pairs(lsmeans(M, "Foo"))) .This results in calling confint.emmGrid() with the possibility of reacting on multiplicity adjusted CI's instead of confint.lm() without the possibilty of multiplicity adjustments if you call confint() .— Regards, Detlew |
ElMaestro ★★★ Denmark, 2019-01-07 23:22 (2268 d 17:39 ago) @ d_labes Posting: # 19757 Views: 4,815 |
|
Dear d_labes, ❝ ❝ This behavior is described in the man page of lsmeans/pairs or summary.emmGrid. Thanks for the explanation; I had no idea R worked this way. And you are exactly right the options are listed in the emmeans documentation (added value for me: it seems I must kiss the lsmeans package goodbye and install emmeans in stead). Whether or not "eat.my.shorts" should result in "bonferroni" or the default "tukey" or something else is probably a matter of personal taste. I don't think I have a qualified opinion on that aspect and it is not a crucial matter at all for me and probably for anyone on the planet. ![]() I am just very delighted I got an answer to exactly the questions that baffled me. Thanks for the help. ![]() ![]() ![]() ![]() — Pass or fail! ElMaestro |