Announcement

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

  • problem with keeping many selected variables

    Hi everyone,

    I am using Stata /SE 16.0 on Mac . I am using a survey data

    My question is :
    When i run my code using "keep "command to keep selected variables for my analysis,Stata seems run this command well as i don't see any error messages , But I still get the full number of variables ,which means the total number of variables haven't changed at all.

    Here is my code (I directly copied and paste from Stata because i can't submit a png file)
    :
    keep AGE2002 RESRELN MOMAGE DADAGE HOMESCHL SEGRADES FSMEETNG FSATCNFN FSSPORT FSVOLNTR ///
    FSVOLCLS FSFUNDRS MOMSTAT MOMLIVW DADSTAT DADLIVW NRPHONY1 NRLETTY1 NRPERY1 NRMTCNF1 NRSPORT1 ///
    NRVOLNT1 NRPHONY2 NRLETTY2 NRPERY2 NRMTCNF2 NRSPORT2 NRVOLNT2 HINCOME ALLGRADE DADEDUC DADEMPLD ///
    FAMILY HH18OVER HHDAD HHMOM HHPARN1 HHTOTAL MOMEDUC MOMEMPLD NONRTYP1 NONRTYP2 NUMSIBS PARGRADE ///
    BASMID FPWT FPWT1 FPWT2 FPWT3 FPWT4 FPWT5 FPWT6 FPWT7 FPWT8 FPWT9 FPWT10 FPWT11 FPWT12 FPWT13 ///
    FPWT14 FPWT15 FPWT16 FPWT17 FPWT18 FPWT19 FPWT20 FPWT21 FPWT22 FPWT23 FPWT24 FPWT25 FPWT26 ///
    FPWT27 FPWT28 FPWT29 FPWT30 FPWT31 FPWT32 FPWT33 FPWT34 FPWT35 FPWT36 FPWT37 FPWT38 ///
    FPWT39 FPWT40 FPWT41 FPWT42 FPWT43 FPWT44 FPWT45 FPWT46 FPWT47 FPWT48 FPWT49 FPWT50 ///
    FPWT51 FPWT52 FPWT53 FPWT54 FPWT55 FPWT56 FPWT57 FPWT58 FPWT59 FPWT60 FPWT61 FPWT62 FPWT63 ///
    FPWT64 FPWT65 FPWT66 FPWT67 FPWT68 FPWT69 FPWT70 FPWT71 FPWT72 FPWT73 FPWT74 FPWT75 FPWT76 ///
    FPWT77 FPWT78 FPWT79 FPWT80 PPSU PSTRATUM ///


    And here is how Stata replies :

    . do "/var/folders/p5/t2vh33zx4k97vtb2dqpx85_c0000gn/T//SD63552.000000"

    . keep AGE2002 RESRELN MOMAGE DADAGE HOMESCHL SEGRADES FSMEETNG FSATCNFN FSSPORT FSVOLNTR //
    > /
    > FSVOLCLS FSFUNDRS MOMSTAT MOMLIVW DADSTAT DADLIVW NRPHONY1 NRLETTY1 NRPERY1 NRMTCNF1 NRSPORT1
    > ///
    > NRVOLNT1 NRPHONY2 NRLETTY2 NRPERY2 NRMTCNF2 NRSPORT2 NRVOLNT2 HINCOME ALLGRADE DADEDUC DADEMPLD
    > ///
    > FAMILY HH18OVER HHDAD HHMOM HHPARN1 HHTOTAL MOMEDUC MOMEMPLD NONRTYP1 NONRTYP2 NUMSIBS PARGRADE
    > ///
    > BASMID FPWT FPWT1 FPWT2 FPWT3 FPWT4 FPWT5 FPWT6 FPWT7 FPWT8 FPWT9 FPWT10 FPWT11 FPWT12 FPWT13
    > ///
    > FPWT14 FPWT15 FPWT16 FPWT17 FPWT18 FPWT19 FPWT20 FPWT21 FPWT22 FPWT23 FPWT24 FPWT25 FPWT26
    > ///
    > FPWT27 FPWT28 FPWT29 FPWT30 FPWT31 FPWT32 FPWT33 FPWT34 FPWT35 FPWT36 FPWT37 FPWT38 ///
    > FPWT39 FPWT40 FPWT41 FPWT42 FPWT43 FPWT44 FPWT45 FPWT46 FPWT47 FPWT48 FPWT49 FPWT50 ///
    > FPWT51 FPWT52 FPWT53 FPWT54 FPWT55 FPWT56 FPWT57 FPWT58 FPWT59 FPWT60 FPWT61 FPWT62 FPWT63 //
    > /
    > FPWT64 FPWT65 FPWT66 FPWT67 FPWT68 FPWT69 FPWT70 FPWT71 FPWT72 FPWT73 FPWT74 FPWT75 FPWT76 //
    > /
    > FPWT77 FPWT78 FPWT79 FPWT80 PPSU PSTRATUM ///

    end of do-file

    Last edited by Yadan Xie; 10 Oct 2023, 09:03.
Working...
X