Aha. Many thanks, John. Never would have gotten there on my own.
-- Bert
On Sat, Jul 8, 2023 at 2:01 PM John Fox wrote:
>
> Hi Bert,
>
> On 2023-07-08 3:42 p.m., Bert Gunter wrote:
> > Caution: This email may have originated from outside the organization.
> > Please exercise additional caution
Hi Bert,
On 2023-07-08 3:42 p.m., Bert Gunter wrote:
Caution: This email may have originated from outside the organization. Please
exercise additional caution with any links and attachments.
Thanks John.
?boxcox says:
*
Arguments
object
a formula or fitted model ob
Thanks John.
?boxcox says:
*
Arguments
object
a formula or fitted model object. Currently only lm and aov objects are handled.
*
I read that as saying that
boxcox(lm(z+1 ~ 1),...)
should run without error. But it didn't. And perhaps here's why:
Dear Ron and Bert,
First (and without considering why one would want to do this, e.g.,
adding a start of 1 to the data), the following works for me:
-- snip --
> library(MASS)
> BoxCoxLambda <- function(z){
+ b <- boxcox(z + 1 ~ 1,
+ lambda = seq(-5, 5, length.out = 1
No, I'm afraid I'm wrong. Something went wrong with my R session and gave
me incorrect answers. After restarting, I continued to get the same error
as you did with my supposed "fix." So just ignore what I said and sorry for
the noise.
-- Bert
On Sat, Jul 8, 2023 at 8:28 AM Bert Gunter wrote:
>
Try this for your function:
BoxCoxLambda <- function(z){
y <- z
b <- boxcox(y + 1 ~ 1,lambda = seq(-5, 5, length.out = 61), plotit =
FALSE)
b$x[which.max(b$y)]# best lambda
}
***I think*** (corrections and clarification strongly welcomed!) that `~`
(the formula function) is looking f
6 matches
Mail list logo