|
Administrator
|
Hello folks. I want to run some simulations to confirm a power estimate obtained with another program. Here's the syntax:
* --- Start of syntax --- . * Simulation to obtain power for proposed study . * Analysis with PASS2008 suggested that n = 6 per group would * ensure 80% power. new file. dataset close all. data list free / group (f1.0). begin data 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 end data. dataset name rawdata . numeric y (f5.2). exe. * Macro to generate data & run analysis . define !GO (N = !tokens(1)) !DO !i = 1 !to !N do if (group EQ 1). - compute y = rv.normal(.5, .25). /* mean = .5, SD = .25 . else. - compute y = rv.normal(1, .5). /* mean = 1, SD = .5 . end if. exe. * Contrast: G1 vs [G2, G3, G4] . ONEWAY y BY group /CONTRAST=-3 1 1 1 /MISSING ANALYSIS. !doend !enddefine. * --- End of Macro Definition --- . * Use OMS to turn off output of ANOVA summary tables and * tables of Contrast Coefficients, and to send the contrast * results to a new dataset called CONTRASTS . OMS /SELECT TABLES /IF COMMANDS=['Oneway'] SUBTYPES=['ANOVA' 'Contrast Coefficients'] /DESTINATION VIEWER=NO. DATASET DECLARE contrasts. OMS /SELECT TABLES /IF COMMANDS=['Oneway'] SUBTYPES=['Contrast Tests'] /DESTINATION FORMAT=SAV NUMBERED=TableNumber_ OUTFILE='contrasts' VIEWER=NO. * Call the macro . !GO N = 10 . OMSEND. /* Turn off OMS . * Activate the datset containing the contrast results . dataset activate contrasts. compute signif = (Sig.2tailed LE .05). recode var2 ("Assume equal variances" = 1) ("Does not assume equal variances" = 2) into version. format signif version (f1.0). var lab signif 'Statistically significant' version 'Version of test' . val lab version 1 'Equal variances assumed' 2 'Equal variances NOT assumed' . * Mean of SIGNIF = proportion of contrasts that are significant. means signif by version / cells = mean count . * --- End of syntax --- . If I have adequate power with 6 subjects per group, 80% of the contrasts should be significant. The problem is that all 3 parts of the ONEWAY output are appearing in my output viewer, despite my attempts to suppress them via OMS--but no warnings or error messages appear. Can anyone spot a problem with my OMS commands? In the syntax shown here, I only loop 10 times (for testing), so it's not that big a deal. But when I run it for real, I'll want to loop a much larger number of times, and I won't want all that output. FWIW, I'm using version 17.0.3 for Windoze. Thanks, Bruce
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
|
OMS affects output between the OMS command and the OMSEND command. Your ONEWWAY command is outside the OMS block.
-----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Bruce Weaver Sent: Tuesday, October 20, 2009 3:57 PM To: [hidden email] Subject: OMS problem: Output not being suppressed Hello folks. I want to run some simulations to confirm a power estimate obtained with another program. Here's the syntax: * --- Start of syntax --- . * Simulation to obtain power for proposed study . * Analysis with PASS2008 suggested that n = 6 per group would * ensure 80% power. new file. dataset close all. data list free / group (f1.0). begin data 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 end data. dataset name rawdata . numeric y (f5.2). exe. * Macro to generate data & run analysis . define !GO (N = !tokens(1)) !DO !i = 1 !to !N do if (group EQ 1). - compute y = rv.normal(.5, .25). /* mean = .5, SD = .25 . else. - compute y = rv.normal(1, .5). /* mean = 1, SD = .5 . end if. exe. * Contrast: G1 vs [G2, G3, G4] . ONEWAY y BY group /CONTRAST=-3 1 1 1 /MISSING ANALYSIS. !doend !enddefine. * --- End of Macro Definition --- . * Use OMS to turn off output of ANOVA summary tables and * tables of Contrast Coefficients, and to send the contrast * results to a new dataset called CONTRASTS . OMS /SELECT TABLES /IF COMMANDS=['Oneway'] SUBTYPES=['ANOVA' 'Contrast Coefficients'] /DESTINATION VIEWER=NO. DATASET DECLARE contrasts. OMS /SELECT TABLES /IF COMMANDS=['Oneway'] SUBTYPES=['Contrast Tests'] /DESTINATION FORMAT=SAV NUMBERED=TableNumber_ OUTFILE='contrasts' VIEWER=NO. * Call the macro . !GO N = 10 . OMSEND. /* Turn off OMS . * Activate the datset containing the contrast results . dataset activate contrasts. compute signif = (Sig.2tailed LE .05). recode var2 ("Assume equal variances" = 1) ("Does not assume equal variances" = 2) into version. format signif version (f1.0). var lab signif 'Statistically significant' version 'Version of test' . val lab version 1 'Equal variances assumed' 2 'Equal variances NOT assumed' . * Mean of SIGNIF = proportion of contrasts that are significant. means signif by version / cells = mean count . * --- End of syntax --- . If I have adequate power with 6 subjects per group, 80% of the contrasts should be significant. The problem is that all 3 parts of the ONEWAY output are appearing in my output viewer, despite my attempts to suppress them via OMS--but no warnings or error messages appear. Can anyone spot a problem with my OMS commands? In the syntax shown here, I only loop 10 times (for testing), so it's not that big a deal. But when I run it for real, I'll want to loop a much larger number of times, and I won't want all that output. FWIW, I'm using version 17.0.3 for Windoze. Thanks, Bruce ----- -- Bruce Weaver [hidden email] http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." NOTE: My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. -- View this message in context: http://www.nabble.com/OMS-problem%3A-Output-not-being-suppressed-tp25982408p25982408.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
Administrator
|
However, that ONEWAY command is within a macro definition, and the call to the macro (!GO N = 10) does fall between the OMS commands and OMSEND. But as we all know, computers and software sometimes do unexpected things. So...I tried it with both the macro definition and the call to the macro placed between the OMS and OMSEND commands. Result: No difference. Then, I added a single ONEWAY command after calling the macro (with N = 3 loops), and before OMSEND. The output viewer had all of the ONEWAY output for the 3 times it ran via the looping macro, but did not have any output for the one direct call to ONEWAY. So, the moral of the story seems to be that suppression of output via OMS does not work when commands are called via macros. This is a real pain in the backside. Is this a version 17 problem, or does the same thing happen in earlier (and later) versions?
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
|
My bad. I missed the fact that the ONEWAY command was embedded in a macro. But there must be something else going on, because OMS will work on output generated from a macro:
data list free /x. begin data 1 2 3 end data. define !fred(). frequencies variables=x /barchart. !enddefine. oms select tables /if subtypes=['Frequencies', 'Statistics'] /destination viewer=no. * This seems to work. Frequencies tables suppressed. * But log, chart, and text output displayed correctly. !fred. list. omsend. From: SPSSX(r) Discussion on behalf of Bruce Weaver Sent: Tue 10/20/2009 5:10 PM To: [hidden email] Subject: Re: OMS problem: Output not being suppressed Oliver, Richard wrote: |
|
Administrator
|
In reply to this post by Bruce Weaver
I should have added that the contrast results do get directed to the 'contrasts' dataset, even when ONEWAY is called via the macro. It's only the suppression of output that does not work when ONEWAY (or any other command, presumably) is called via the macro.
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
|
In reply to this post by Bruce Weaver
When I use OMS in a macro, I put an OMS command before the actual OMS selection command:
OMS /DESTINATION VIEWER=NO /TAG='suppressall'. OMS/SELECT TABLES ... That works (I have these commands within the macro, probably will work also when outside the macro)
Regards, Anita From: SPSSX(r) Discussion on behalf of Bruce Weaver Sent: Wed 21-Oct-09 00:10 To: [hidden email] Subject: Re: OMS problem: Output not being suppressed Oliver, Richard wrote: ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. **********************************************************************
|
|
Administrator
|
In reply to this post by Bruce Weaver
Apparently it is a version 17 problem. I've heard from someone off-list who said: "If I run your code in V15 or V18, the tables are properly suppressed. In 17.0.2, they are not." The suggested workaround for v17 is to include an OUTPUT CLOSE command in the macro. The unwanted tables will still be generated, but the output viewer will close on each loop, so I won't have an output viewer full of tables at the end.
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
| Free forum by Nabble | Edit this page |
