Hello, I am trying to use the powerTransform function in the package car to identify the lambda: transform my data. However, I receive the following warning: Warning message: In estimateTransform(x, y, NULL, ...) : Convergence failure: return code = 1 I can not find a description of what return code =1 means for the car package. How do I look that up, or does anyone know what the warning means? Thank you so much! Brittany [[alternative HTML version deleted]]
Dear Brittany, As explained in ?powerTransform, this function uses optim() to optimize a generalized Box-Cox criterion. For explanation of return codes, see ?optim. In particular, code 1 indicates that the maximum number of iterations was exceeded. Although you might try increasing the permitted number of iterations or otherwise tweaking the arguments to optim(), your problem is probably ill-conditioned in some manner that is impossible to know without more information, such as your data. I hope this helps, John ------------------------------------------------ John Fox, Professor McMaster University Hamilton, Ontario, Canada http://socserv.mcmaster.ca/jfox/ On Wed, 10 Jun 2015 10:54:30 -0600 Brittany Demmitt <demmitba at gmail.com> wrote:> Hello, > > I am trying to use the powerTransform function in the package car to identify the lambda: transform my data. However, I receive the following warning: > > Warning message: > In estimateTransform(x, y, NULL, ...) : > Convergence failure: return code = 1 > > I can not find a description of what return code =1 means for the car package. How do I look that up, or does anyone know what the warning means? > > Thank you so much! > > Brittany > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Dear Brittany, There is an essentially perfect linear dependency among the variables in your data (note the last eigenvalue, which is 0 within rounding error):> eigen(cor(problem.data.boxcox[,-1]), only.values=TRUE)$values [1] 3.644257e+00 1.821582e+00 1.712152e+00 1.205091e+00 1.007231e+00 9.231163e-01 9.048724e-01 [8] 8.718398e-01 8.379187e-01 7.371353e-01 6.334100e-01 5.235629e-01 4.757997e-01 4.246831e-01 [15] 2.773471e-01 -2.802502e-16 In addition, some of your variables have many tied values at the bottom of their distributions, making them very poor candidates for normalizing power transformations; for example,> sum(problem.data.boxcox$variable2 == 1)[1] 626 I hope this helps, John ------------------------------------------------ John Fox, Professor McMaster University Hamilton, Ontario, Canada http://socserv.mcmaster.ca/jfox/ On Thu, 11 Jun 2015 09:37:57 -0600 Brittany Demmitt <demmitba at gmail.com> wrote:> Hi John, > > Thank you so much for the info! I have attached the data in .csv format that is giving me the warning along with the command that I am running. It i a data frame with 1510 sample IDs and then their values for 16 variables. I am trying to transform the 16 variables. I do not receive the warning when I run each variable independently, just when I run the entire dataframe at once. However, I have run this command with other larger data frames all at once with no warnings, so I am not sure why it is not working now. > > Any help is appreciated! Thanks! :-) > > Britt > > Commands Run: > > #read in the data frame > problem.data.boxcox <- read.csv(?problem.data.boxcox.csv") > > #run a power transformation (I do not run that on the first column because it is just sample ids) > > problem.data.boxcox.pT <- powerTransform(problem.data.boxcox[,-1]) > > Warning message: > In estimateTransform(x, y, NULL, ...) : > Convergence failure: return code = 1 > > > > > > > > > > > On Jun 10, 2015, at 2:15 PM, John Fox <jfox at mcmaster.ca> wrote: > > > > Dear Brittany, > > > > As explained in ?powerTransform, this function uses optim() to optimize a generalized Box-Cox criterion. For explanation of return codes, see ?optim. > > > > In particular, code 1 indicates that the maximum number of iterations was exceeded. Although you might try increasing the permitted number of iterations or otherwise tweaking the arguments to optim(), your problem is probably ill-conditioned in some manner that is impossible to know without more information, such as your data. > > > > I hope this helps, > > John > > > > ------------------------------------------------ > > John Fox, Professor > > McMaster University > > Hamilton, Ontario, Canada > > http://socserv.mcmaster.ca/jfox/ > > > > > > On Wed, 10 Jun 2015 10:54:30 -0600 > > Brittany Demmitt <demmitba at gmail.com> wrote: > >> Hello, > >> > >> I am trying to use the powerTransform function in the package car to identify the lambda: transform my data. However, I receive the following warning: > >> > >> Warning message: > >> In estimateTransform(x, y, NULL, ...) : > >> Convergence failure: return code = 1 > >> > >> I can not find a description of what return code =1 means for the car package. How do I look that up, or does anyone know what the warning means? > >> > >> Thank you so much! > >> > >> Brittany > >> [[alternative HTML version deleted]] > >> > >> ______________________________________________ > >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > >> https://stat.ethz.ch/mailman/listinfo/r-help > >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > >> and provide commented, minimal, self-contained, reproducible code. > > > > > > > > >
Hi John, That does help, thanks! Brittany> On Jun 11, 2015, at 4:02 PM, John Fox <jfox at mcmaster.ca> wrote: > > Dear Brittany, > > There is an essentially perfect linear dependency among the variables in your data (note the last eigenvalue, which is 0 within rounding error): > >> eigen(cor(problem.data.boxcox[,-1]), only.values=TRUE) > $values > [1] 3.644257e+00 1.821582e+00 1.712152e+00 1.205091e+00 1.007231e+00 9.231163e-01 9.048724e-01 > [8] 8.718398e-01 8.379187e-01 7.371353e-01 6.334100e-01 5.235629e-01 4.757997e-01 4.246831e-01 > [15] 2.773471e-01 -2.802502e-16 > > In addition, some of your variables have many tied values at the bottom of their distributions, making them very poor candidates for normalizing power transformations; for example, > >> sum(problem.data.boxcox$variable2 == 1) > [1] 626 > > I hope this helps, > John > > ------------------------------------------------ > John Fox, Professor > McMaster University > Hamilton, Ontario, Canada > http://socserv.mcmaster.ca/jfox/ > > > > On Thu, 11 Jun 2015 09:37:57 -0600 > Brittany Demmitt <demmitba at gmail.com> wrote: >> Hi John, >> >> Thank you so much for the info! I have attached the data in .csv format that is giving me the warning along with the command that I am running. It i a data frame with 1510 sample IDs and then their values for 16 variables. I am trying to transform the 16 variables. I do not receive the warning when I run each variable independently, just when I run the entire dataframe at once. However, I have run this command with other larger data frames all at once with no warnings, so I am not sure why it is not working now. >> >> Any help is appreciated! Thanks! :-) >> >> Britt >> >> Commands Run: >> >> #read in the data frame >> problem.data.boxcox <- read.csv(?problem.data.boxcox.csv") >> >> #run a power transformation (I do not run that on the first column because it is just sample ids) >> >> problem.data.boxcox.pT <- powerTransform(problem.data.boxcox[,-1]) >> >> Warning message: >> In estimateTransform(x, y, NULL, ...) : >> Convergence failure: return code = 1 >> >> >> >> >> >> >> >> >> >>> On Jun 10, 2015, at 2:15 PM, John Fox <jfox at mcmaster.ca> wrote: >>> >>> Dear Brittany, >>> >>> As explained in ?powerTransform, this function uses optim() to optimize a generalized Box-Cox criterion. For explanation of return codes, see ?optim. >>> >>> In particular, code 1 indicates that the maximum number of iterations was exceeded. Although you might try increasing the permitted number of iterations or otherwise tweaking the arguments to optim(), your problem is probably ill-conditioned in some manner that is impossible to know without more information, such as your data. >>> >>> I hope this helps, >>> John >>> >>> ------------------------------------------------ >>> John Fox, Professor >>> McMaster University >>> Hamilton, Ontario, Canada >>> http://socserv.mcmaster.ca/jfox/ >>> >>> >>> On Wed, 10 Jun 2015 10:54:30 -0600 >>> Brittany Demmitt <demmitba at gmail.com> wrote: >>>> Hello, >>>> >>>> I am trying to use the powerTransform function in the package car to identify the lambda: transform my data. However, I receive the following warning: >>>> >>>> Warning message: >>>> In estimateTransform(x, y, NULL, ...) : >>>> Convergence failure: return code = 1 >>>> >>>> I can not find a description of what return code =1 means for the car package. How do I look that up, or does anyone know what the warning means? >>>> >>>> Thank you so much! >>>> >>>> Brittany >>>> [[alternative HTML version deleted]] >>>> >>>> ______________________________________________ >>>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >>>> https://stat.ethz.ch/mailman/listinfo/r-help >>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >>>> and provide commented, minimal, self-contained, reproducible code. >>> >>> >>> >>> >> > >