Is there a way to create a conditional fail?
This will stop the production and keep it from continuing. e.g. if x=1 causeError. |
Administrator
|
Perhaps you would provide a bit more context if you expect a response?
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
|
You properly describe that the MH test is testing for ordered
alternatives, so I am confused by your actual question at the end. Can "MH ... be applied to ... nominal level data...?" - Sure, if you want to test the ordered hypotheses. For the general test of heterogeneity, No. The List had a discussion on 5/17/2013 and 5/18/2013 that drew distinctions between several tests. Subject: Repeated Measures Chi Squared. http://spssx-discussion.1045642.n5.nabble.com/Repeated-Measures-Chi-Squared-tt5720309.html Searching is easier when you correct the spelling to Bowker. -- Rich Ulrich Date: Tue, 25 Jun 2013 21:15:44 -0700 From: [hidden email] Subject: Marginal Homogenenity: SPSS vs. Stata To: [hidden email]
|
In reply to this post by ChetMeinzer
SIGNOFF SPSSX-L Dwane Allen, Ph.D. |
In reply to this post by David Marso
Yes, sometimes its so clear when you are immersed.
clarification: I'm running code through production mode with a settings 'interrupt processing at error'. My need is for the code to stop running if a condition is met. So, we set up a scenario where if two dates are the same, we want the code to stop running, otherwise to continue to other jobs in the same production. We have it set to stop running upon errors, so if i can create an error, I can stop when the condition is met. Thus, I want the syntax to produce an error if a condition is met. I need will stop the overnight production mode from running more code. Is there a better method to use in the first place, and is this a job for python? Thanks |
Administrator
|
I've never used the Production Facility, but if all you need is for an error to occur when the two dates are equal, how about something like this?
COMPUTE @junk@ = 1 / (Date2 - Date1).
--
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 ChetMeinzer
> From: ChetMeinzer <[hidden email]>
> To: [hidden email] > Cc: > Sent: Tuesday, June 25, 2013 11:30 PM > Subject: [SPSSX-L] Intentional Fail > > Is there a way to create a conditional fail? > This will stop the production and keep it from continuing. > e.g. > if x=1 causeError. Like this? You could also use assert 1 not in record, "oh no, now what?" or simply raise a RuntimeError or whatever. dataset declare agg. compute target = (x eq 1). aggregate outfile = agg /target = max(target). begin program. import spss class ChetMeinzerError(Exception): pass try: cur = spss.Cursor() record = cur.fetchone()[0] # not sure about [0] if 1 in record: raise ChetMeinzerError("oh no, now what?") finally: cur.close() spss.Submit("dataset close agg.") end program. ===================== 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 |
In reply to this post by Bruce Weaver
close
That gives me a warning, but i need a level 3 error to stop processing. |
In reply to this post by Dwane Allen
How am I supposed to use this forum? From: Dwane Allen [via SPSSX Discussion] [mailto:[hidden email]]
Dwane Allen, Ph.D. If you reply to this email, your message will be added to the discussion below: http://spssx-discussion.1045642.n5.nabble.com/Intentional-Fail-tp5720891p5720904.html To unsubscribe from Intentional Fail, click here. |
You can subscribe to: [hidden email] From: ChetMeinzer [via SPSSX Discussion] [mailto:[hidden email]] How am I supposed to use this forum? |
In reply to this post by ChetMeinzer
----- Original Message -----
> From: ChetMeinzer <[hidden email]> > To: [hidden email] > Cc: > Sent: Wednesday, June 26, 2013 8:48 PM > Subject: Re: [SPSSX-L] Intentional Fail > > close > That gives me a warning, but i need a level 3 error to stop processing. Please post your code/syntax and also consider bottom-posting as this thread is hard to follow, esp. for those who search the archives. * sample data. data list free / x (f). begin data 1 0 0 0 end data. * code. dataset declare agg. compute target = (x eq 1). aggregate outfile = agg /target = max(target). dataset activate agg. /* I previously forgot this command. begin program. import spss try: cur = spss.Cursor() record = cur.fetchone() if 1 in record: raise RuntimeError("oh no, now what?") finally: cur.close() spss.Submit("dataset close agg.") end program. Returns the following: Traceback (most recent call last): File "<string>", line 9, in <module> RuntimeError: oh no, now what? ===================== 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 |
Free forum by Nabble | Edit this page |