Re: [R] sem package, suppress warnings
Have you tried suppressWarnings(sem(mod, S = as.matrix(dataset), N = 1000, maxiter = 1, warn = FALSE)) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Dustin Fife Sent: Saturday, 19 January 2013 5:32a To: r-help Subject: [R] sem package, suppress warnings Hi, I'm using the sem package under conditions where I know beforehand that several models will be problematic. Because of that, I want to suppress warnings. I've used the following code sem(mod, S = as.matrix(dataset), N = 1000, maxiter = 1, warn = FALSE) But I still get warnings. I've also tried adding check.analytic = FALSE, debug = FALSE, and that doesn't seem to do it either. Any ideas why it's not working? It may be important to note that the command above is wrapped within a function and I'm using try() to avoid errors. Thanks in advance! -- Dustin Fife PhD Student Quantitative Psychology University of Oklahoma [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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. __ R-help@r-project.org mailing list 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.
Re: [R] sem package, suppress warnings
Dear Dustin and Steve, For some reason, I didn't see Dustin's original message. As documented in ?sem, the warn argument to sem() covers only warnings directly produced by the optimizer, warn: if TRUE, warnings produced by the optimization function will be printed. This should generally not be necessary, since sem prints its own warning, and saves information about convergence. The default is FALSE. It doesn't cover the warnings produced by sem() itself. For that, you can do as Steve suggests, or simply set options(warn = -1). The debug argument is FALSE by default and if TRUE prints the iteration history and some additional information; it is irrelevant to warnings. I hope this helps, John --- John Fox Senator McMaster Professor of Social Statistics Department of Sociology McMaster University Hamilton, Ontario, Canada -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Steve Taylor Sent: Sunday, January 20, 2013 3:22 PM To: Dustin Fife; r-help Subject: Re: [R] sem package, suppress warnings Have you tried suppressWarnings(sem(mod, S = as.matrix(dataset), N = 1000, maxiter = 1, warn = FALSE)) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Dustin Fife Sent: Saturday, 19 January 2013 5:32a To: r-help Subject: [R] sem package, suppress warnings Hi, I'm using the sem package under conditions where I know beforehand that several models will be problematic. Because of that, I want to suppress warnings. I've used the following code sem(mod, S = as.matrix(dataset), N = 1000, maxiter = 1, warn = FALSE) But I still get warnings. I've also tried adding check.analytic = FALSE, debug = FALSE, and that doesn't seem to do it either. Any ideas why it's not working? It may be important to note that the command above is wrapped within a function and I'm using try() to avoid errors. Thanks in advance! -- Dustin Fife PhD Student Quantitative Psychology University of Oklahoma [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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. __ R-help@r-project.org mailing list 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. __ R-help@r-project.org mailing list 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.
Re: [R] sem package, suppress warnings
Perfect! That did it, and I learned a new function :) On Sun, Jan 20, 2013 at 2:49 PM, John Fox j...@mcmaster.ca wrote: Dear Dustin and Steve, For some reason, I didn't see Dustin's original message. As documented in ?sem, the warn argument to sem() covers only warnings directly produced by the optimizer, warn: if TRUE, warnings produced by the optimization function will be printed. This should generally not be necessary, since sem prints its own warning, and saves information about convergence. The default is FALSE. It doesn't cover the warnings produced by sem() itself. For that, you can do as Steve suggests, or simply set options(warn = -1). The debug argument is FALSE by default and if TRUE prints the iteration history and some additional information; it is irrelevant to warnings. I hope this helps, John --- John Fox Senator McMaster Professor of Social Statistics Department of Sociology McMaster University Hamilton, Ontario, Canada -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Steve Taylor Sent: Sunday, January 20, 2013 3:22 PM To: Dustin Fife; r-help Subject: Re: [R] sem package, suppress warnings Have you tried suppressWarnings(sem(mod, S = as.matrix(dataset), N = 1000, maxiter = 1, warn = FALSE)) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Dustin Fife Sent: Saturday, 19 January 2013 5:32a To: r-help Subject: [R] sem package, suppress warnings Hi, I'm using the sem package under conditions where I know beforehand that several models will be problematic. Because of that, I want to suppress warnings. I've used the following code sem(mod, S = as.matrix(dataset), N = 1000, maxiter = 1, warn = FALSE) But I still get warnings. I've also tried adding check.analytic = FALSE, debug = FALSE, and that doesn't seem to do it either. Any ideas why it's not working? It may be important to note that the command above is wrapped within a function and I'm using try() to avoid errors. Thanks in advance! -- Dustin Fife PhD Student Quantitative Psychology University of Oklahoma [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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. __ R-help@r-project.org mailing list 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. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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.
[R] sem package, suppress warnings
Hi, I'm using the sem package under conditions where I know beforehand that several models will be problematic. Because of that, I want to suppress warnings. I've used the following code sem(mod, S = as.matrix(dataset), N = 1000, maxiter = 1, warn = FALSE) But I still get warnings. I've also tried adding check.analytic = FALSE, debug = FALSE, and that doesn't seem to do it either. Any ideas why it's not working? It may be important to note that the command above is wrapped within a function and I'm using try() to avoid errors. Thanks in advance! -- Dustin Fife PhD Student Quantitative Psychology University of Oklahoma [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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.