Announcement

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

  • Help with opening only the relevant variables in a dataset that is too large to open in my version of stata

    Hello, I am a new user of stata working with data from large DHS datasets from multiple countries.

    I have downloaded the relevant folders from DHS, but when I try and open it I get this message


    . use "C:\Users\2019833\OneDrive - University of Chester\dissertation\IR womens
    > folder data\ETIR71DT\ETIR71FL.DTA"
    no room to add more variables
    Up to 2,048 variables are allowed with this version of Stata. Versions
    are available that allow up to 120,000 variables.
    r(900);

    From the do file I have identified the names of the variables that are relevant to me as

    label variable v624 "Unmet need"
    label variable v626 "Unmet need (definition 2)"
    label variable v626a "Unmet need for contraception (definition 3)"
    label variable v133 "Education in single years"
    label variable v106 "Highest educational level"
    label variable v107 "Highest year of education"
    label variable v149 "Educational attainment"
    label variable v012 "Respondent's current age"
    label variable awfactw "All woman factor - wealth index"
    label variable v190 "Wealth index combined"
    label variable v3a08j "Reason not using: husband/partner opposed"
    label variable v621 "Husband's desire for children"
    label variable v137 "Number of children 5 and under in household (de jure)"
    label variable v201 "Total children ever born"
    label variable v218 "Number of living children"
    label variable v714 "Respondent currently working"
    label variable awfactu "All woman factor - urban/rural"

    this is where all the data for one of the countries is saved in stata format

    C:\Users\2019833\OneDrive - University of Chester\dissertation\IR womens folder data\ETIR71DT


    Am I able to just open these variables and drop the thousands of others preventing me from opening the data?

    Help is greatly appreciated

    Rebecca

  • #2
    the second syntax in the help file shows you how to load a subset of the variables; see
    Code:
    help use

    Comment


    • #3
      following help use, I tried this
      use [varlist] [if] [in] using filename [, clear nolabel]


      but Im still having issues


      . help use

      . use [v624, v010] [if] [in] usingETIR71FL.DTA [, clear nolabel]
      invalid 'v624'
      r(198);

      . use [variable v624, variable v010] [if] [in] usingETIR71FL.DTA [, clear nolabel]
      invalid 'variable'
      r(198);

      Comment


      • #4
        do not include the square brackets - in Stata syntax rules, square brackets are shown in the help file/manual for items that are optional; however, when actually including such elements you should not iclude the square brackets; further, if you are not using "if" or "in", neither they nor their square brackets should be included Z(same with the comma and anything following it); you should definitely start with either a StataCorp course for new users or should read the getting started with Stata manual (three were included in your installation; read the one for your OS)

        Comment


        • #5
          Originally posted by Rebecca Taylor View Post
          following help use, I tried this
          use [varlist] [if] [in] using filename [, clear nolabel]


          but Im still having issues


          . help use

          . use [v624, v010] [if] [in] usingETIR71FL.DTA [, clear nolabel]
          invalid 'v624'
          r(198);

          . use [variable v624, variable v010] [if] [in] usingETIR71FL.DTA [, clear nolabel]
          invalid 'variable'
          r(198);
          Try:

          Code:
          use v624 v010 using ETIR71FL, clear
          Notice that there should be a space after "using" as well. The thing coming after "using" is assumed to be a Stata file with dta extension so it can be omitted.

          And to see the getting started manual, use command:

          Code:
          help getting_started
          gsw is for Windows, gsm for Mac, and gsu for Unix.

          Comment

          Working...
          X