Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Use of data originating from SPSS - update


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: Use of data originating from SPSS - update
Date   Tue, 7 Feb 2012 11:55:24 +0000

Thanks for the closure. As an experiment, I did this to simulate what may have happened: 

. sysuse auto, clear
(1978 Automobile Data)

. replace foreign = foreign + 1
(74 real changes made)

. logit foreign weight

outcome does not vary; remember:
                                  0 = negative outcome,
        all other nonmissing values = positive outcome
r(2000);

. mfp: logit foreign weight
r(2000);

Here the deliberately posed problem is that the response is coded 1 and 2, rather than 0 and 1 (or 0 and positive). Note how a bare -logit- call explains exactly what is wrong from Stata's point of view, but calling -logit- under the aegis of -mfp- eats the informative message, leaving only the return code. 

r(2000) is a very general error message, meaning "no observations [to do that with]". That usually is diagnostic of string variables or missing values, but here Stata means "no observations to which I can fit a logit model". 

I doubt there's a quick and easy fix to -mfp- because it is such a general command. 

Notice also how experienced Stata users are so used to Stata's requirements for logit modelling that they did not conceive that there could be another way! 

Nick 
[email protected] 

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Margaret MacDougall


I grabbed a spare moment to dip into a Stata manual on my journey home 
from work today and noted that for a logistic regression analysis, Stata 
requires one of the categories of my dependent variable to assume the 
value '0'. This pointed to a very simple solution (which worked) while 
highlighting a necessary change which needs to be made in the transition 
from SPSS to Stata which I was previously unaware of.  Creating a new 
coding in SPSS for the categories of the dependent variable while saving 
the modified SPSS file in Stata format did the trick.

On 03/02/2012 23:03, Margaret MacDougall wrote:

> Thanks, Nick, but as far as codebook is concerned, my data are quite 
> healthy and there is not a missing data issue. Due to other 
> commitments, I have very limited time to spend on this problem. 
> However, I have resolved to try a diffierent trick most days untill I 
> strike gold and to post my main finding to the Stata list users 
> regarding how the issue was resolved.


> On 02/02/2012 22:15, Nick Cox wrote:
>> As said, if it's not a problem with variables being (mis)read as 
>> string, then it sounds like a problem with missings. Have a look at 
>> your data e.g. using -codebook- and opening the Data Editor and see 
>> whether and where there are missings and whether they match what is 
>> seen by SPSS.

Margaret MacDougall

>> By way of an update, I have also applied the latest patch so as to
>> upgrade to SPSS 19.0.0.2 and then re-saved in Stata format using the
>> SPSS dialogue box. However, this has not eliminated my original error
>> message pointing to there be "no observations" for my "statistical
>> calculation".

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index