Announcement

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

  • #16
    Oh wow, thanks - hadn't thought of that at all. Indeed I had blanks all over the place as I generated the variable lists from a Python file of mine rather than from the PSID website. It's still a bit weird to me that this would manifest itself in the 1997 error (rather than giving an error on the first variable), but in any case it's working now without the blanks.

    I guess it's a classical example of a non-STATA user being confused by the syntax STATA uses to call functions...

    Comment


    • #17
      Dear Ulrich,
      I was very glad to find your very useful psidtool for Stata.
      I would like to load wealth data (Total Family Wealth) for all available waves. I tried the following (after installing all necessary waves):
      psid use || wealth [84]S116 [89]S216 [94]S316 [99]S416 [01]S516 [03]S616 [05]S716 [07]S816 [09]ER46968 [11]ER52392 [13]ER58209 using $path
      Unfortunately, this doesn’t seem to work with your toolbox. As far as I understand, the wealth files are no longer downloadable as ‘supplementary files’ (i.e. as wlth1984.zip, wlth1989.zip, ..., wlth2007.zip) but rather, they are now integrated into the main family files (fam1968.zip, fam1969.zip ...).
      Is there any way I could still install the wealth data with your toolbox?
      Thanks!
      Max

      Comment


      • #18
        Dear Max,

        As it stands the PSID tools assume that variable from the wealth files are distributed in separate files. Hence, unless you have the "old" versions of the wealth files lying around in the psid-data-folder, you cannot access these variable with psid use. I will change this in the next version of the PSID tools, however I cannot make any promises when the new version will be ready. I can only say that I can not do it this week.

        Comment


        • #19
          Dear Ulrich,

          let me thanks you for the amazing job you did with this package.
          I am now trying to create a dataset using it, but I am stuck with a couple of problems:

          1. I am trying to upload some variables using the add command with the code:

          Code:
          psid add || ASSETS [94]S315 [99]S415 [01]S515 [03]S615 [05]S715 [07]S815 ///
           [09]ER46960 [11]ER52364 [13]ER58177 using "/Users/mac/Downloads/Data"
          or similarly:

          Code:
          psid add || CHECKSAV [94]S305 [99]S405 [01]S505 [03]S605 [05]S705 [07]S805 ///
          [09]ER46942 [11]ER52350 [13]ER58161 using "/Users/mac/Downloads/Data"
          However, all the variables that start with S, followed by the number (ex. S315) cannot be uploaded giving me error r(601);
          I tried also to use the same command removing S-variables and leaving only the ER-variables (ex. ER58177) and everything works fine.
          I suppose this is in some way linked to missing data for those specific variables, but I have downloaded and installed all the waves till the last year.
          This is also unexpected as from the variable search in the PSID website all these variables are grouped under the same variable label.

          2. Is it possible to exploit the package for the early-release packaged data?

          Thanks for your help!

          Comment


          • #20
            Originally posted by Luca Gagliardone View Post
            Dear Ulrich,

            let me thanks you for the amazing job you did with this package.
            I am now trying to create a dataset using it, but I am stuck with a couple of problems:

            1. I am trying to upload some variables using the add command with the code:

            Code:
            psid add || ASSETS [94]S315 [99]S415 [01]S515 [03]S615 [05]S715 [07]S815 ///
            [09]ER46960 [11]ER52364 [13]ER58177 using "/Users/mac/Downloads/Data"
            or similarly:

            Code:
            psid add || CHECKSAV [94]S305 [99]S405 [01]S505 [03]S605 [05]S705 [07]S805 ///
            [09]ER46942 [11]ER52350 [13]ER58161 using "/Users/mac/Downloads/Data"
            However, all the variables that start with S, followed by the number (ex. S315) cannot be uploaded giving me error r(601);
            I tried also to use the same command removing S-variables and leaving only the ER-variables (ex. ER58177) and everything works fine.
            I suppose this is in some way linked to missing data for those specific variables, but I have downloaded and installed all the waves till the last year.
            This is also unexpected as from the variable search in the PSID website all these variables are grouped under the same variable label.

            2. Is it possible to exploit the package for the early-release packaged data?

            Thanks for your help!
            Dear Luca,

            this is because these variables were originally stored in the so called "wealth-files" which were now inserted into the "family files". -psid use- and -psid add- searches for the variable in the wealth files. Unless you do not have old versions of the files in your psid-directory, -psid use- fails.

            Back in February I mentioned somewhere else on Statalist that I will update psid use to that new structure, but I haven't so far. Still plans to do it, but ...

            For now you must either get the PSID wealth files from somewhere, or add those variables by hand using official Stata's -merge- command.



            Comment


            • #21
              Dear Ulrich,

              Many thanks for your fantastic program psid use! It has been of great help to me.

              I have a question that perhaps is not a programming question and more a question of the PSID, but it comes up in the course of using your command and thus perhaps this is the right forum.

              The question is -- in the data for wave == 1968, who are all of the people with person weights equal to zero? They seem to have a lot of family variables populated for the year 1968, but they were not in the survey then! It is extremely confusing to me.

              See the code below:

              psid use || faminc [68]V81 [69]V529 [70]V1514 [71]V2226 [72]V2852 [73]V3256 [74]V3676 [75]V4154 [76]V5029 [77]V5626 [78]V6173 [79]V6766 [80]V7412 [81]V8065 [82]V8689 [83]V9375 [84]V11022 [85]V12371 [86]V13623 [87]V14670 [88]V16144 [89]V17533 [90]V18875 [91]V20175 [92]V21481 [93]V23322 [94]ER4153 [95]ER6993 [96]ER9244 [97]ER12079 [99]ER16462 [01]ER20456 [03]ER24099 [05]ER28037 [07]ER41027 [09]ER46935 [11]ER52343 [13]ER58152 ///
              || age_head [68]V117 [69]V1008 [70]V1239 [71]V1942 [72]V2542 [73]V3095 [74]V3508 [75]V3921 [76]V4436 [77]V5350 [78]V5850 [79]V6462 [80]V7067 [81]V7658 [82]V8352 [83]V8961 [84]V10419 [85]V11606 [86]V13011 [87]V14114 [88]V15130 [89]V16631 [90]V18049 [91]V19349 [92]V20651 [93]V22406 [94]ER2007 [95]ER5006 [96]ER7006 [97]ER10009 [99]ER13010 [01]ER17013 [03]ER21017 [05]ER25017 [07]ER36017 [09]ER42017 [11]ER47317 [13]ER53017 ///
              || married [68]V239 [69]V607 [70]V1365 [71]V2072 [72]V2670 [73]V3181 [74]V3598 [75]V4053 [76]V4603 [77]V5650 [78]V6197 [79]V6790 [80]V7435 [81]V8087 [82]V8711 [83]V9419 [84]V11065 [85]V12426 [86]V13665 [87]V14712 [88]V16187 [89]V17565 [90]V18916 [91]V20216 [92]V21522 [93]V23336 [94]ER4159A [95]ER6999A [96]ER9250A [97]ER12223A [99]ER16423 [01]ER20369 [03]ER24150 [05]ER28049 [07]ER41039 [09]ER46983 [11]ER52407 [13]ER58225 ///
              || race_head [68]V181 [69]V801 [70]V1490 [71]V2202 [72]V2828 [73]V3300 [74]V3720 [75]V4204 [76]V5096 [77]V5662 [78]V6209 [79]V6802 [80]V7447 [81]V8099 [82]V8723 [83]V9408 [84]V11055 [85]V11938 [86]V13565 [87]V14612 [88]V16086 [89]V17483 [90]V18814 [91]V20114 [92]V21420 [93]V23276 [94]ER3944 [95]ER6814 [96]ER9060 [97]ER11848 [99]ER15928 [01]ER19989 [03]ER23426 [05]ER27393 [07]ER40565 [09]ER46543 [11]ER51904 [13]ER57659 ///
              || sex_head [68]V119 [69]V1010 [70]V1240 [71]V1943 [72]V2543 [73]V3096 [74]V3509 [75]V3922 [76]V4437 [77]V5351 [78]V5851 [79]V6463 [80]V7068 [81]V7659 [82]V8353 [83]V8962 [84]V10420 [85]V11607 [86]V13012 [87]V14115 [88]V15131 [89]V16632 [90]V18050 [91]V19350 [92]V20652 [93]V22407 [94]ER2008 [95]ER5007 [96]ER7007 [97]ER10010 [99]ER13011 [01]ER17014 [03]ER21018 [05]ER25018 [07]ER36018 [09]ER42018 [11]ER47318 [13]ER53018 ///
              || fam_size [68]V115 [69]V549 [70]V1238 [71]V1941 [72]V2541 [73]V3094 [74]V3507 [75]V3920 [76]V4435 [77]V5349 [78]V5849 [79]V6461 [80]V7066 [81]V7657 [82]V8351 [83]V8960 [84]V10418 [85]V11605 [86]V13010 [87]V14113 [88]V15129 [89]V16630 [90]V18048 [91]V19348 [92]V20650 [93]V22405 [94]ER2006 [95]ER5005 [96]ER7005 [97]ER10008 [99]ER13009 [01]ER17012 [03]ER21016 [05]ER25016 [07]ER36016 [09]ER42016 [11]ER47316 [13]ER53016 ///
              || inc_head [68]V74 [69]V514 [70]V1196 [71]V1897 [72]V2498 [73]V3051 [74]V3463 [75]V3863 [76]V5031 [77]V5627 [78]V6174 [79]V6767 [80]V7413 [81]V8066 [82]V8690 [83]V9376 [84]V11023 [85]V12372 [86]V13624 [87]V14671 [88]V16145 [89]V17534 [90]V18878 [91]V20178 [92]V21484 [93]V23323 [94]ER4140 [95]ER6980 [96]ER9231 [97]ER12080 [99]ER16463 [01]ER20443 [03]ER24116 [05]ER27931 [07]ER40921 [09]ER46829 [11]ER52237 [13]ER58038 ///
              || inc_wife1 [68]V75 [69]V516 [70]V1198 [71]V1899 [72]V2500 [73]V3053 [74]V3465 [75]V3865 [76]V4379 [77]V5289 [78]V5788 [79]V6398 [80]V6988 [81]V7580 [82]V8273 [83]V8881 [84]V10263 [85]V11404 [86]V12803 [87]V13905 [88]V14920 [89]V16420 [90]V17836 [91]V19136 [92]V20436 [93]V23324 ///
              || inc_wife2 [93]V21807 [94]ER4144 [95]ER6984 [96]ER9235 [97]ER12082 [99]ER16465 [01]ER20447 [03]ER24135 [05]ER27943 [07]ER40933 [09]ER46841 [11]ER52249 [13]ER58050 ///
              || w_exhome [84]S116 [89]S216 [94]S316 [99]S416 [01]S516 [03]S616 [05]S716 [07]S816 [09]ER46968 [11]ER52392 [13]ER58209 ///
              || w_total [84]S117 [89]S217 [94]S317 [99]S417 [01]S517 [03]S617 [05]S717 [07]S817 [09]ER46970 [11]ER52394 [13]ER58211 ///
              || w_stock [84]S111 [89]S211 [94]S311 [99]S411 [01]S511 [03]S611 [05]S711 [07]S811 [09]ER46954 [11]ER52358 [13]ER58171 ///
              || w_annu_ira [99]S419 [01]S519 [03]S619 [05]S719 [07]S819 [09]ER46964 [11]ER52368 [13]ER58181 ///
              || w_business [84]V10908 [89]V17323 [94]ER3731 [99]ER15002 [01]ER19198 [03]ER22563 [05]ER26544 [07]ER37562 [09]ER43553 [11]ER48878 ///
              || relationship_head [68]ER30003 [69]ER30022 [70]ER30045 [71]ER30069 [72]ER30093 [73]ER30119 [74]ER30140 [75]ER30162 [76]ER30190 [77]ER30219 [78]ER30248 [79]ER30285 [80]ER30315 [81]ER30345 [82]ER30375 [83]ER30401 [84]ER30431 [85]ER30465 [86]ER30500 [87]ER30537 [88]ER30572 [89]ER30608 [90]ER30644 [91]ER30691 [92]ER30735 [93]ER30808 [94]ER33103 [95]ER33203 [96]ER33303 [97]ER33403 [99]ER33503 [01]ER33603 [03]ER33703 [05]ER33803 [07]ER33903 [09]ER34003 [11]ER34103 [13]ER34203 ///
              || family_id_alt [69]V534 [70]V1230 [71]V1932 [72]V2533 [73]V3085 [74]V3497 [75]V3909 [76]V4423 [77]V5336 [78]V5835 [79]V6446 [80]V7050 [81]V7642 [82]V8335 [83]V8943 [84]V10400 [85]V11581 [86]V12988 [87]V14090 [88]V15105 [89]V16605 [90]V18021 [91]V19321 [92]V20621 [93]V22400 [94]ER2005G [95]ER5005G [96]ER7005G [97]ER10005G [99]ER13019 [01]ER17022 [03]ER21009 [05]ER25009 [07]ER36009 [09]ER42009 [11]ER47309 [13]ER53009 ///
              || family_comp_change [69]V542 [70]V1109 [71]V1809 [72]V2410 [73]V3010 [74]V3410 [75]V3810 [76]V4310 [77]V5210 [78]V5710 [79]V6310 [80]V6910 [81]V7510 [82]V8210 [83]V8810 [84]V10010 [85]V11112 [86]V12510 [87]V13710 [88]V14810 [89]V16310 [90]V17710 [91]V19010 [92]V20310 [93]V21608 [94]ER2005A [95]ER5004A [96]ER7004A [97]ER10004A [99]ER13008A [01]ER17007 [03]ER21007 [05]ER25007 [07]ER36007 [09]ER42007 [11]ER47307 [13]ER53007 ///
              || person_wt [68]ER30019 [69]ER30042 [70]ER30066 [71]ER30090 [72]ER30116 [73]ER30137 [74]ER30159 [75]ER30187 [76]ER30216 [77]ER30245 [78]ER30282 [79]ER30312 [80]ER30342 [81]ER30372 [82]ER30398 [83]ER30428 [84]ER30462 [85]ER30497 [86]ER30534 [87]ER30569 [88]ER30605 [89]ER30641 [90]ER30686 [91]ER30730 [92]ER30803 ///
              || family_wt [68]V439 [69]V1014 [70]V1609 [71]V2321 [72]V2968 [73]V3301 [74]V3721 [75]V4224 [76]V5099 [77]V5665 [78]V6212 [79]V6805 [80]V7451 [81]V8103 [82]V8727 [83]V9433 [84]V11079 [85]V12446 [86]V13687 [87]V14737 [88]V16208 [89]V17612 [90]V18943 [91]V20243 [92]V21547 ///
              using $datalocation, design(any) keepnote


              psid long

              sum faminc if wave==1968 & person_wt==0


              We see there is data on family incomes for 43,030 individuals for 1968! Am I confused? Or does anyone have an explanation,

              Many thanks,

              Jake

              Comment


              • #22
                https://psidonline.isr.umich.edu/ states: "The study began in 1968 with a nationally representative sample of over 18,000 individuals living in 5,000 families in the United States." So, to me, it seems that they were in the field already.

                A related question is, why there are 43.030 individuduals instead of approx 18.000. This is a consequence of -design(any)- here. When using -design(any)- it is often sensible to restrict the observation base to "persons" in the family at the time of the interview after reshaping to long. In order to do this you may want to type

                . keep if inrange(xsqnr, 1, 50)

                I don't know why these persons got a sampling weight of zero.

                Last edited by Ulrich Kohler; 14 Dec 2016, 12:17.

                Comment


                • #23
                  Dear Ulrich,

                  Thank you so much for this wonderful package!

                  I have a question regarding how your package calls variables from the individual file. I'm running into various errors and inconsistencies adding individual age/gender.

                  I install all files using psid install, which unpacks all data (including the individual file).

                  Starting with gender, I then try the following three things, getting different results each time:

                  Code:
                  psid use || gender [68]ER32000 using "~path"
                  Results in error variable xsqnr_* not found

                  Code:
                  psid use || gender [69]ER32000 using "~path"
                  Results in error variable ER32000 not found

                  On the other hand,

                  Code:
                  psid use || gender [13]ER32000 using "~path"
                  works just fine, but produces fewer observations(23,575) than are available in the individual file (75,252)

                  I suspect that this last code only retrieves gender information for respondents of the 2013 wave, but I'm trying to figure out a way to retrieve this information for all respondents in all waves. Assuming that running the code above for [13]ER32000 gives me gender of all respondents: not only those active in 2013, but also those who've dropped out of the sample between 1968 and 2013, I can fill in the blanks, but am I correct to assume this?

                  Finally, since the variable is the same for every wave, as per PSID website, I tried listing all waves with the same variable name (code below). As you can imagine, this led to a "variable not found error" since this was the error for 1969.

                  Code:
                  psid use || gender ///
                              [68]ER32000 [69]ER32000 [70]ER32000 [71]ER32000 [72]ER32000 [73]ER32000 [74]ER32000 ///
                              [75]ER32000 [76]ER32000 [77]ER32000 [78]ER32000 [79]ER32000 [80]ER32000 [81]ER32000 ///
                              [82]ER32000 [83]ER32000 [84]ER32000 [85]ER32000 [86]ER32000 [87]ER32000 [88]ER32000 ///
                              [89]ER32000 [90]ER32000 [91]ER32000 [92]ER32000 [93]ER32000 [94]ER32000 [95]ER32000 ///
                              [96]ER32000 [97]ER32000 [99]ER32000 [01]ER32000 [03]ER32000 [05]ER32000 [07]ER32000 ///
                              [09]ER32000 [11]ER32000 [13]ER32000 ///
                              using "~path", clear
                  So, If [13]ER32000 provides only the gender of the active 2013 respondents, how would I go about adding the rest?

                  Now, turning to age, the code (below) works just fine, but again I end up with far fewer observations for each. For example, the individual file contains ages of 24,933 respondents between 1 and 100 years old for 2013 (ER34204), while the code below leaves me with age2103 of 2,497 individuals ages 44 to 100.

                  Code:
                  psid use || age ///
                              [68]ER30004 [69]ER30023 [70]ER30046 [71]ER30070 [72]ER30094 [73]ER30120 [74]ER30141 ///
                              [75]ER30163 [76]ER30191 [77]ER30220 [78]ER30249 [79]ER30286 [80]ER30316 [81]ER30346 ///
                              [82]ER30376 [83]ER30402 [84]ER30432 [85]ER30466 [86]ER30501 [87]ER30538 [88]ER30573 ///
                              [89]ER30609 [90]ER30645 [91]ER30692 [92]ER30736 [93]ER30809 [94]ER33104 [95]ER33204 ///
                              [96]ER33304 [97]ER33404 [99]ER33504 [01]ER33604 [03]ER33704 [05]ER33804 [07]ER33904 ///
                              [09]ER34004 [11]ER34104 [13]ER34204 ///
                              using "~path"
                  Is this attrition due to the fact that family files have only one observation per household and only age of the household head is reported? Even if so, I would expect some household heads to be younger than 44, an expectation supported by the fam2013er.dta file (ER53017) that has 9,061 household heads aged 16 to 100.

                  I suppose, my overall question is this: should I expect to see something like if I were to do a many-to-one merge with the individual file as a master and family files as using? That is, would the information from the family file get duplicated for each member of the family listed in the individual file?

                  Thank you again so very much for this package, it's saving me weeks of brute force merging, much appreciated!

                  Tamara









                  Comment


                  • #24
                    Originally posted by Ulrich Kohler View Post
                    https://psidonline.isr.umich.edu/ states: "The study began in 1968 with a nationally representative sample of over 18,000 individuals living in 5,000 families in the United States." So, to me, it seems that they were in the field already.

                    A related question is, why there are 43.030 individuduals instead of approx 18.000. This is a consequence of -design(any)- here. When using -design(any)- it is often sensible to restrict the observation base to "persons" in the family at the time of the interview after reshaping to long. In order to do this you may want to type

                    . keep if inrange(xsqnr, 1, 50)

                    I don't know why these persons got a sampling weight of zero.
                    Many thanks for your response. And thank you again for your fantastic program.

                    Comment


                    • #25
                      Dear Ulrich, I have been struggling with "psid use" command for two days, still couldnt figure out my problem and decide to seek help here. I am using Stata 13 on mac and I use ind2015er as the individual file. I installed all the family files and individual file successfully. I try to run something very simple :

                      #delimit ;
                      set more off;
                      clear all;
                      set maxvar 30000, permanently;
                      cd "/Users/jack/Dropbox/Literature/PSID2";
                      psid use
                      || release_number
                      [68]V1 [69]V441 [70]V1101 [71]V1801 [72]V2401 [79]V6335 using "/Users/jack/Dropbox/Literature/PSID2", dofile(debug) clear;

                      I get the following error: file /Users/jack/Dropbox/Literature/PSID2/.dta not found.
                      The debug file seems to stop half way through with its content slightly changes in each execution. It is attached here. debug.do
                      Do you know what is going wrong here? I feel like it is related with the individual file but not sure.
                      jack

                      Comment


                      • #26
                        Dear Ulrich,

                        I am trying to use the toolbox to open the new wave (2015) family file, but the PSID open does not seem to work. Whenever I try to open a file from 2015 wave, I get an "invalid name" error message. I also had the same issue as Jack Calvin and got rid of it when I changed the year in the 2015 individual file into 2013. My question is if there is any way around to be able to open the 2015 wave data with the toolbox?

                        Comment


                        • #27
                          Dear PSID-Tools Users,

                          this is just to notify that the psid-tools, so far, do not work with the most recent delivery of the PSID. I will publish an update of -psid use- as soon as possible.
                          Many regards
                          Uli

                          Comment


                          • #28
                            Thank you!

                            Comment


                            • #29
                              Thanks for sharing the program, Ulrich.

                              I use Stata/SE 14.2 with OS X 10.10.5. I have two questions on psidtools for you, or others who use it:

                              a) I have been able to run psidtools with the most recent delivery of the PSID, just by changing the name of the ind2015er file to “ind2013er”. As far as anyone can tell, does this create other problems?

                              b) I am not sure I quite grasp what psid use does. I use the following command to import the present job’s 3-digit industry codes:

                              Code:
                              psid use  || ind3main70 ///
                                       [81]V7713 [82]V8381 [83]V9012 [84]V10461 [85]V11652 [86]V13055 [87]V14155 ///
                              [88]V15163 [89]V16664 [90]V18102 [91]V19402 [92]V20702 [93]V22457 ///
                              [94]ER4018 [95]ER6858 [96]ER9109 [97]ER12086 [99]ER13216 [01]ER17227 ///
                              using ~/PSID, clear keepnotes design(any) ///
                              dofile(PSIDBuild1Internal, replace)
                              My “PSID” folder contains fam1980.dta-fam2013er.dta files and the ind2013er.dta file (renamed from the ind2015er.dta file).

                              As clear from above, info on the 3-digit industry for 1996 is contained in the variable ER9109, which is found in the fam1996 file. After running psid use, I ran:

                              Code:
                              tab ind3main701996
                              I then opened the fam1996.dta file and ran:

                              Code:
                              tab ER9109
                              In my understanding of psid use, ind3main701996 contains information from ER9109 and nothing else. So I thought that the two tabulations should be similar, if not the same. But the two tabulations differ. Does any know why? I have tried keeping the design balanced, reshaping the data to long etc. but I cannot recover something close to ER9109.

                              As a side, I am new to the PSID: even though I am reading the documentation, I may be missing something about the PSID itself, not just psidtools.

                              Thanks,
                              Tommaso
                              Last edited by Tommaso Tempesti; 11 Jul 2017, 13:07. Reason: typos

                              Comment


                              • #30
                                Dear Ulrich,

                                I am trying to get some variables from the Transition into Adulthood supplements. In particular, I would like to add the income information

                                psid use || income [05]TA050954 [07]TA070935 [09]TA090999 [11]TA111141 [13]TA131232 [15]TA151292 using $path, clear design(any)

                                But it does not seem to work. Other supplements I have worked with seem to work, marriage history file for example.

                                I suppose this is a problem similar to the wealth files you have mentioned. I would like to confirm.

                                Thank you very much!

                                Comment

                                Working...
                                X