Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stata to Mplus data transfer

    Could someone please help me to find out how to transfer a .dta file onto Mplus?

    I know that there is stata2mplus command just do not know how to get Stata extension for Stata se13 (64 bit) to proceed successfully with the command.

    Please help

    Kind regards

    Witold
    Last edited by Witold Orlik; 28 Mar 2018, 04:05.

  • #2
    type
    -search stata2mplus-

    or look at
    https://stats.idre.ucla.edu/stata/fa...lus-data-file/
    Doug Hemken
    SSCC, Univ. of Wisc.-Madison

    Comment


    • #3
      You may also use the user-written - runmplus - to run MPlus from Stata.
      Best regards,

      Marcos

      Comment


      • #4
        Thanks for your advice,

        @Doug,

        I used that link but could not open the downloaded file...

        Then, I was trying to find relevant files to be downloaded directly through stata and coud not find them on the list...

        , is it possible that my stata version 13 (64 bit) is too old version for this?


        @ Marcos, could you please provide any more details I typed in runmplus into stata but the command was not recognized.

        Thank you again


        Witold

        Comment


        • #5
          @ Marcos, could you please provide any more details I typed in runmplus into stata but the command was not recognized.
          Hello, Witold. It is a user-written program. Therefore, you need to find it, then install it. To find it, you may try - findit runmplus - and see what happens. If you don't get it by this command, please let us know. As soon as I come back to "my" Stata, I can check it out.

          For now, the help files of - runmplus - may interest you as well.
          Last edited by Marcos Almeida; 28 Mar 2018, 09:14.
          Best regards,

          Marcos

          Comment


          • #6
            Hello guys,

            I installed this succesfully SJ-15-4, dm67_4 (please see attachment) and still obtaining this in my stata window: "unrecognized command: stata2mplus"

            Not sure what is wrong as it SHOULD be working fine now. Stata is up to date and I restarted comaputer. Any ideas? Please and thank you
            Attached Files

            Comment


            • #7
              I don't understand what your attachment has to do with stata2mplus. The attachment refers to a different file.

              Just do

              findit stata2mplus

              and you will be a couple of clicks away from having it installed.
              -------------------------------------------
              Richard Williams, Notre Dame Dept of Sociology
              StataNow Version: 19.5 MP (2 processor)

              EMAIL: [email protected]
              WWW: https://www3.nd.edu/~rwilliam

              Comment


              • #8
                Your Stata version is not a problem.
                After you type -findit stata2mplus- or -search stata2mplus- you should see the following image. Click on the third link.
                Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	117.1 KB
ID:	1436675
                Doug Hemken
                SSCC, Univ. of Wisc.-Madison

                Comment


                • #9
                  This is a very basic step to download user-written programs. That said, you need to select the "right one" carefully. I'm not with "my" Stata at this moment, but you'll probably get several embedded links after typing - findit runmplus - as recommended in #3, #5,, and #7 (or stata2mplus as well). This is to say that, after typing the - findit - command - , please take a look at the links. Some of them are texts, some of them are programs, but not exactly the one you're looking for.
                  Last edited by Marcos Almeida; 29 Mar 2018, 08:14.
                  Best regards,

                  Marcos

                  Comment


                  • #10
                    Hello guys,

                    Thanks everybody for help.

                    Richard Williams - it worked now, thank you very much.

                    Now I can think about Easter, so... Happy Easter to all fo yous

                    Comment


                    • #11
                      Dear all
                      Tried to follow this thread for some solutions, but havent found any.

                      I am trying to find ways to download "stata2mplus" but I get an error message when I am working in STATA in the VDI or datalab environment since I do not have access to the internet. Is it possible to download this package for converting stata files to Mplus, then I can bring in the installation files in VDI. How can I get this package into VDI so I am able to convert my STATA files to MPlus

                      Comment


                      • #12
                        Originally posted by Fadzai Chikwava View Post
                        I am trying to find ways to download "stata2mplus" but I get an error message when I am working in STATA in the VDI or datalab environment since I do not have access to the internet. Is it possible to download this package for converting stata files to Mplus, then I can bring in the installation files in VDI.
                        You could try something like the following on a machine that has Internet access.
                        Code:
                        local URL https://stats.oarc.ucla.edu/stat/stata/ado/analysis
                        local file_list stata2mplus.ado stata2mplus.hlp
                        foreach file of local file_list {
                            copy "`URL'/`file'" "`c(pwd)'/`file'"
                        }
                        The two files (ADO and help) will be copied into your working directory. You can then copy or move them to a removable disc or drive, bring them on that into your VDI (whatever that is) or laboratory and copy them to your working directory there, assuming that you're permitted to. Stata will be able to use them from your working directory.

                        In the meantime, why not just use the official Stata outfile?

                        Its use is illustrated below with selected integer and floating-point variables of the auto dataset as probes. Crosschecking output from the two passages of code below (one a DO file and the other the corresponding MPlus INP file), they give the same regression coefficients & standard errors, residual variances & covariances (spot checked only).
                        Code:
                        version 17.0
                        
                        clear *
                        
                        quietly sysuse auto
                        
                        outfile price mpg headroom trunk weight length turn displacement gear_ratio ///
                            foreign using Auto.dat, wide nolabel
                        
                        recast double price weight
                        quietly replace price = price / 1000
                        quietly replace weight = weight / 2000
                        
                        sem (price mpg headroom trunk weight length turn displacement ///
                            gear_ratio <- foreign), ///
                                covstructure(e._OEn, unstructured) ///
                                nocnsreport nodescribe nofootnote nolog
                        
                        exit
                        Format any floating-point variables to the precision that you need beforehand.
                        Code:
                        TITLE:  Import from Stata
                        DATA:
                                FILE IS Auto.dat;
                        VARIABLE:
                                NAMES ARE PRI MPG HEA TRU WEI LEN TUR DIS GEA FOR;
                        DEFINE:
                                PRI = PRI / 1000;
                                WEI = WEI / 2000;
                        MODEL:
                                PRI-GEA ON FOR;
                                PRI WITH MPG HEA TRU WEI LEN TUR DIS GEA;
                                MPG WITH HEA TRU WEI LEN TUR DIS GEA;
                                HEA WITH TRU WEI LEN TUR DIS GEA;
                                TRU WITH WEI LEN TUR DIS GEA;
                                WEI WITH LEN TUR DIS GEA;
                                LEN WITH TUR DIS GEA;
                                TUR WITH DIS GEA;
                                DIS WITH GEA;

                        Comment


                        • #13
                          Thanks so much for this.

                          Comment

                          Working...
                          X