Announcement

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

  • Question about regression and editing values

    Hello everyone,

    I want to test if people who feel attachment to their region also feel attached to Europe. To test this I want to do a regression analysis. I have so far stumbled onto two problems that I would like to have some input on.

    1. A few observations says: "I dont know" or "no answer". How do I remove this?

    2. In the answer to the question, very close=1 and not close at all=4. In my head it makes sense to have it the other way around? My statistical knowledge is a bit limited but does this even matter when I do the regression? If so, is there a way to change the values of the answers so very close=4 etc.

    Thanks in advance,
    Fabian

    Click image for larger version

Name:	Skärmavbild 2023-11-26 kl. 14.10.25.png
Views:	2
Size:	27.5 KB
ID:	1735159 Click image for larger version

Name:	Skärmavbild 2023-11-26 kl. 14.08.47.png
Views:	1
Size:	27.9 KB
ID:	1735158
    Attached Files

  • #2
    What you are showing is a tabulation of a variable with value labels. If the label very close corresponds to values of 1 and not close at all to values of 4, then presumably the first two categories have corresponding values less than 1 and the observations you want to ignore can be omitted by insisting that the regression is done only

    Code:
    ... if inrange(Q45D, 1, 4)
    where I am guessing that the variable is called
    Code:
    Q45D
    .

    Otherwise, reversing 1 to 4 to 4 to 1 is just a matter of subtraction.

    Code:
    gen Q45Dnew = 5 - Q45D if inrange(Q45D, 1, 4)
    You would need to define value labels correspondingly.

    That has an intended side-effect of ignoring what you want to ignore. Most experienced researchers would, I guess, treat a variable like this as ordered categorical, not as strongly measured.

    Comment


    • #3
      Also cross-posted at https://www.reddit.com/r/stata/comme..._of_variables/

      As commented there, telling people about cross-posting is a request here and a rule there.

      Comment

      Working...
      X