Announcement

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

  • IMPORTING DATA AS STRING FROM EXCEL

    Hi guys, I have imported some data from excel into STATA as string. After creating the dataset with relevant labels and variable names, I simply wanted to summarize the data in STATA and hence I typed in the 'summarize' command. However, for some reason, it fails to recognise any of my variables and lists 0,0,0,0..... for the mean, median, max and min SD etc. I tried importing it again, this time as the default (i.e. the 'import as string' box was unchecked and STATA seems to summarize the data perfectly. However, I want my data to be summarized as a string. Can anyone help? Its really annoying.

  • #2
    Summarize doesn't work on string variables. Means etc don't make sense for strings. ISee example using auto data below.


    Code:
    . desc make price
    
                  storage   display    value
    variable name   type    format     label      variable label
    ---------------------------------------------------------------------------------------------------------
    make            str18   %-18s                 Make and Model
    price           int     %8.0gc                Price
    
    . sum make price
    
        Variable |       Obs        Mean    Std. Dev.       Min        Max
    -------------+--------------------------------------------------------
            make |         0
           price |        74    6165.257    2949.496       3291      15906
    Richard T. Campbell
    Emeritus Professor of Biostatistics and Sociology
    University of Illinois at Chicago

    Comment


    • #3
      STATA92: Please read the FAQ Advice all the way through, especially Sections 6 and 18. Otherwise, it's not clear why you are annoyed. Stata will summarize numeric variables only, as Richard clearly explained.

      Comment


      • #4
        Originally posted by Nick Cox View Post
        STATA92: Please read the FAQ Advice all the way through, especially Sections 6 and 18. Otherwise, it's not clear why you are annoyed. Stata will summarize numeric variables only, as Richard clearly explained.
        Wow. That response is rude AF. Hopefully, you aren't as mean now as you were in 2014.

        Comment


        • #5
          I am just as mean as I was in 2014. I have posted about 30,000 times since then and answered many questions. Meanwhile your own post is not constructive and itself is much ruder than what you complain about.

          Comment

          Working...
          X