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]

Re: st: Amelia object as data.frame


From   Laura Maria Schwirz <[email protected]>
To   [email protected]
Subject   Re: st: Amelia object as data.frame
Date   Wed, 27 Feb 2013 10:33:34 +0000

Thanks, Billy. I haven't written my own programmes and am fairly new
to this. Any suggestions on how to change the programme so it supports
rclass programmes? I also tried the cmdok option which does not work
for the same reason.
I'd rather work within the same package and ideally work with Stata.

Thanks,
Laura

On 26 February 2013 15:27, William Buchanan <[email protected]> wrote:
> Hi Laura,
>
> The issue that Daniel pointed out wasn't that MI doesn't support -msp-, but that -msp- does not support MI data.  For more information, see -help program_properties##mi- which explains some of the information that programmers use to make their packages support MI data.  One reason that the program is likely incompatible with the -mi estimate- command is that -msp- is an rclass program (a point that Nick Cox made yesterday in response to your previous thread).
>
> That being said, you could always use -msp- as a framework to develop your own procedure (say -msp2-) that would be an eclass program and would support MI commands.
>
> HTH,
> Billy
>
>
>
> On Feb 26, 2013, at 7:08 AM, Laura Maria Schwirz <[email protected]> wrote:
>
>> Thanks for your advice. Stata's mi does in fact not support msp and
>> appears to allow mainly for various types of regression. Using another
>> programme to impute data is just one option although as you very well
>> point out I do need to bear in mind assumptions underlying mi and MSP.
>>
>> On 26 February 2013 14:09, daniel klein <[email protected]> wrote:
>>> Aside from the obvious -- R questions are not the topic to be
>>> discussed on Statalist -- based on your earlier question
>>> (http://www.stata.com/statalist/archive/2013-02/msg00960.html) I get
>>> the impression you switch software, because Stata did not do what you
>>> wanted.
>>>
>>> That is not necessarily a problem, but just some words of caution.
>>>
>>> Chaniging to another software, because Stata does not do what you
>>> want, might not always be the best choice, given that there might be
>>> good reason why Stat does not do what you want. Just because a(nother)
>>> software does something, it does not mean that this something makes
>>> any sense, or is statistically "correct".
>>>
>>> In your case the appearant reason -msp- (SSC) does not work with -mi-
>>> is, that its author did not implement it to work with -mi-. Whether
>>> there is a good statistical reason remains unclear to me. My point is,
>>> that in any case you should think carefully about about what you want
>>> to do. If you, for example,  want to combine Loevinger's H, think
>>> about the distribution of this statistic. Is it normal? If not,
>>> applying Rubin's combination rules (regardless of software) might not
>>> be appropriate. This is discussed here:
>>> http://www.stata.com/support/faqs/statistics/combine-results-with-multiply-imputed-data/
>>> along with how to get Stata to combine results from commands that do
>>> not support -mi-.
>>>
>>> btw. Ameliaseems to  assume the data to follow a multivariat normal
>>> distribution, which might not be appropriate with Items used for
>>> Mokken scale analysis, and you need to think about this, too.
>>>
>>> Best
>>> Daniel
>>>
>>> --
>>> Hi Stata Users
>>>
>>> I have run multiple imputations using R's Amelia package and would
>>> like to use the imputed dataset to analyse Mokken Scale Analysis.
>>> But mokken requires the object to be a data frame. I tried
>>> as.data.frame(x) and as.matrix(x) but it says that it cannot coerce
>>> class amelia into a data frame or matrix.
>>>
>>> australia93=as.data.frame(australia93)
>>> Error in as.data.frame.default(australia93) :
>>>  cannot coerce class '"amelia"' into a data.frame
>>>
>>> coefH(australia93)
>>> Error in check.data(X) : Data are not matrix or data.frame
>>>
>>> Any help would be much appreciated.
>>> *
>>> *   For searches and help try:
>>> *   http://www.stata.com/help.cgi?search
>>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>>> *   http://www.ats.ucla.edu/stat/stata/
>>>
>>
>>
>>
>> --
>> Laura Schwirz
>>
>> PhD Candidate and IRCHSS Scholar
>> Department of Political Science
>> Trinity College Dublin
>> Dublin 2
>> Republic of Ireland
>> Email: [email protected]
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>> *   http://www.ats.ucla.edu/stat/stata/
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
>



-- 
Laura Schwirz

PhD Candidate and IRCHSS Scholar
Department of Political Science
Trinity College Dublin
Dublin 2
Republic of Ireland
Email: [email protected]

On 26 February 2013 15:27, William Buchanan <[email protected]> wrote:
> Hi Laura,
>
> The issue that Daniel pointed out wasn't that MI doesn't support -msp-, but that -msp- does not support MI data.  For more information, see -help program_properties##mi- which explains some of the information that programmers use to make their packages support MI data.  One reason that the program is likely incompatible with the -mi estimate- command is that -msp- is an rclass program (a point that Nick Cox made yesterday in response to your previous thread).
>
> That being said, you could always use -msp- as a framework to develop your own procedure (say -msp2-) that would be an eclass program and would support MI commands.
>
> HTH,
> Billy
>
>
>
> On Feb 26, 2013, at 7:08 AM, Laura Maria Schwirz <[email protected]> wrote:
>
>> Thanks for your advice. Stata's mi does in fact not support msp and
>> appears to allow mainly for various types of regression. Using another
>> programme to impute data is just one option although as you very well
>> point out I do need to bear in mind assumptions underlying mi and MSP.
>>
>> On 26 February 2013 14:09, daniel klein <[email protected]> wrote:
>>> Aside from the obvious -- R questions are not the topic to be
>>> discussed on Statalist -- based on your earlier question
>>> (http://www.stata.com/statalist/archive/2013-02/msg00960.html) I get
>>> the impression you switch software, because Stata did not do what you
>>> wanted.
>>>
>>> That is not necessarily a problem, but just some words of caution.
>>>
>>> Chaniging to another software, because Stata does not do what you
>>> want, might not always be the best choice, given that there might be
>>> good reason why Stat does not do what you want. Just because a(nother)
>>> software does something, it does not mean that this something makes
>>> any sense, or is statistically "correct".
>>>
>>> In your case the appearant reason -msp- (SSC) does not work with -mi-
>>> is, that its author did not implement it to work with -mi-. Whether
>>> there is a good statistical reason remains unclear to me. My point is,
>>> that in any case you should think carefully about about what you want
>>> to do. If you, for example,  want to combine Loevinger's H, think
>>> about the distribution of this statistic. Is it normal? If not,
>>> applying Rubin's combination rules (regardless of software) might not
>>> be appropriate. This is discussed here:
>>> http://www.stata.com/support/faqs/statistics/combine-results-with-multiply-imputed-data/
>>> along with how to get Stata to combine results from commands that do
>>> not support -mi-.
>>>
>>> btw. Ameliaseems to  assume the data to follow a multivariat normal
>>> distribution, which might not be appropriate with Items used for
>>> Mokken scale analysis, and you need to think about this, too.
>>>
>>> Best
>>> Daniel
>>>
>>> --
>>> Hi Stata Users
>>>
>>> I have run multiple imputations using R's Amelia package and would
>>> like to use the imputed dataset to analyse Mokken Scale Analysis.
>>> But mokken requires the object to be a data frame. I tried
>>> as.data.frame(x) and as.matrix(x) but it says that it cannot coerce
>>> class amelia into a data frame or matrix.
>>>
>>> australia93=as.data.frame(australia93)
>>> Error in as.data.frame.default(australia93) :
>>>  cannot coerce class '"amelia"' into a data.frame
>>>
>>> coefH(australia93)
>>> Error in check.data(X) : Data are not matrix or data.frame
>>>
>>> Any help would be much appreciated.
>>> *
>>> *   For searches and help try:
>>> *   http://www.stata.com/help.cgi?search
>>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>>> *   http://www.ats.ucla.edu/stat/stata/
>>>
>>
>>
>>
>> --
>> Laura Schwirz
>>
>> PhD Candidate and IRCHSS Scholar
>> Department of Political Science
>> Trinity College Dublin
>> Dublin 2
>> Republic of Ireland
>> Email: [email protected]
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>> *   http://www.ats.ucla.edu/stat/stata/
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
>



--
Laura Schwirz

PhD Candidate and IRCHSS Scholar
Department of Political Science
Trinity College Dublin
Dublin 2
Republic of Ireland
Email: [email protected]

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


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