Announcement

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

  • Problems with importing datasheat

    Hey :D

    I have a problem with importing all the variables from a datasheat. I have mostly categorical variables, which are missing some of categories, when imported into stata. Note the categories, which are missing doesn´t have any frequencies, but I would like to include them and be a part of my analysis. I checked the datasheat in excel where I am able to find the categories.

    Any advice on how to get these missing categories imported, and possible just creating new ones within the existing variables, when imported to stata?
    Last edited by Malthe Viuf; 19 Sep 2022, 04:40.

  • #2
    Originally posted by Malthe Viuf View Post
    I have a problem with importing all the variables from a datasheat. I have mostly categorical variables, which are missing some of categories, when imported into stata. . . .I checked the datasheat in excel where I am able to find the categories.

    Any advice on how to get these missing categories imported . . .?
    Try using the allstring option of the import excel command.

    You can use destring , replace afterward in order to get them all into numeric categories.

    Comment


    • #3
      Hmmm tried the all string, and then used the tab command afterwards to show a variable but it is still missing some of the values (categories) of most variables.

      Comment


      • #4
        It would be useful for you to post a data extract, so others can work with it and try to figure out the issue. Also post the exact Stata code you are using.

        Comment


        • #5
          To note, the datasheat is really small, total responses are 34, and the value missing from these categorical variables are the ones which the respondes hasn´t selected. What I want to do is to make these variabels numeric and in turn recode the values so that I have "0" which would be no effect and "1" which would describe that there are an effect. I am a student and quantativ method isn´t my strong suit, so any advice is appreciated.
          Attached Files

          Comment

          Working...
          X