Announcement

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

  • doubt regarding standard deviation using egen function

    I have tried to find row wise sd for a set of variables from i_a_0 to i_c_1
    syntax: egen rowsd2 = rowsd(i_a_0 - i_c_1 )

    output show error like this

    .unknown egen function rowsd()

    help me to solve this [roblem

  • #2
    can anyone share some useful stata reference materials for beginner. i am following command based operations.

    Comment


    • #3
      That command should work at least for Stata 14 and higher (I don't have older versions on this computer)
      ---------------------------------
      Maarten L. Buis
      University of Konstanz
      Department of history and sociology
      box 40
      78457 Konstanz
      Germany
      http://www.maartenbuis.nl
      ---------------------------------

      Comment


      • #4
        I think rowsd() has been around for several versions. What version of Stata do you think you're using? If It's a pirated version, i.e. not one downloaded from StataCorp or an official Stata distributor, then problems with egen are a known phenomenon.

        Comment


        • #5
          foreach i in 3 4 {
          foreach var in i_b_9 i_b_10 i_b_8 i_b_11 i_b_6 {
          gen `var'b_all_`i' = 0
          replace `var'b_all_`i' = `var'b if `var'_dum_`i' == 1
          replace `var'b_all_`i' = . if `var'_dum_`i' == .
          replace `var'b_all_`i' = 0 if `var'b_all_`i' ==. & `var'_dum_`i' !=.
          gen `var'b_`i' = `var'b_all_`i'
          replace `var'b_`i' = . if `var'_dum_`i' == 0
          * replace `var'b_`i' = 0 if `var'b_`i' ==. & `var'_dum_`i' !=.
          }
          }

          pls help me to read and understand this command

          Comment


          • #6
            There seems to be a disconnect here.

            Please answer the question in #4. Whatever the code in #5 is doing, it's not calculating a standard deviation.

            Where does the code in #5 come from? It seems that you are starting with variables

            i_b_9 i_b_10 i_b_8 i_b_11 i_b_6

            and also those with suffixes

            Code:
            _dum_1 _dum_2 _​​​​​​​dum_3
            ​​​​​​​
            Please give a data example with enough of those variables and explain what it is that you want to do.



            Comment

            Working...
            X