Announcement

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

  • Correlating variables

    Hello everyone, I'm new to this software so I'm still having some problems using it. The problem that I still can't figure out is about correlating variables. I have a dataset made mainly by string variables converted to numeric values, I need to analyse correlation between them, in particular one between a variable with two values (in the same number) and one with 3 values. I'm trying to correlate every single of this 3 value to each one of the other two by using dummy variables but i feel like it's not the right way... Any advice? Thank you
    Last edited by Oliver Don; 24 Jan 2023, 14:55.

  • #2
    Several red flags here.

    I have a dataset made mainly by string variables converted to numeric values,
    There are two ways to do this in Stata, one of which is appropriate for your purpose, and the other is grossly inappropriate. You show no example data, nor code, so there is no way to tell whether you are even working with sensible values at this point.

    I'm trying to correlate every single of this 3 value to each one of the other two by using dummy variables but i feel like it's not the right way...
    There is no statistical meaning of the term correlate for which this kind of approach would be appropriate. So I would ask you to spell out in detail just what it is you actually want to do. Whatever it is, it isn't correlation. Or if it is, you are playing your game in the wrong stadium.

    Please respond with a fuller explanation, and, above all, with example data using the -dataex- command. (It is particularly crucial that you use the -dataex- command for your example data here because the metadata is absolutely critical to helping you in this situation.) If you are running version 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

    When asking for help with code, always show example data. When showing example data, always use -dataex-.

    Comment

    Working...
    X