Announcement

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

  • Creating conditional variables

    I have searched this forum looking for the answer to this question but I am struggling to succinctly articulate what I'm looking for so hopefully I have explained the following post in a way that makes sense.

    I made a post a couple of days ago here (https://www.statalist.org/forums/for...ng-bin-scatter) where I asked how to produce a graph that measured peoples attitudes towards income inequality (which is called incdiffR1) (rated from 1-5) on the y-axis. The first independent variable I used was income decile (which is called hhincdR1) which was measured from 1-10 along the x-axis. The second independent variable I was using (which is called socscaleR1) was people's perceived income decile, also measured from 1-10 across the x-axis. I have attached what the graph looks like below.

    Instead of comparing those who were actually in that income decile to those that perceived they were in that income decile, I would now like to compare those in each income decile who also perceived themselves as being in the range of 4th-6th deciles (so this would be the first line in the line graph) to those who predicted their decile with a reasonable degree of accuracy (this would be the second line in the graph). Income decile would still be along the x-axis as shown in the graph and income inequality would still be on the y-axis.

    To do this I would like to classify 'reasonable accuracy' as: those who were in the bottom 3 deciles who perceived themselves to be in the bottom three deciles (1-3), those who were in the middle three deciles who perceived themselves to be in the middle three deciles (4-6), and those in the top four deciles (7-10) who perceived themselves to be in the top four deciles. This would also mean I would like to exclude those who did not perceive themselves to be in the middle deciles or a reasonably accurate decile, this would be those in the middle who perceived themselves to be in the top or bottom decile bands, those in the top deciles who predicted themselves to be in the bottom deciles, and those in the bottom deciles who predicted themselves to be in the top.

    The first and second lines on the graph would then of course overlap on this graph as they would both be measuring the same thing (reasonably accurate would be in the 4-6th decile which would be the same as the first line which shows those that perceived themselves to be in the 4-6th decile).

    To do this I'm guessing I would need to generate two more variables which are conditional on responses to the perceived income variable along with their actual income decile (a variable for those who were accurate and a variable for those who placed themselves in the middle).

    Click image for larger version

Name:	Incdiffs graph.png
Views:	1
Size:	19.0 KB
ID:	1660824

    Last edited by Jonny McCann; 21 Apr 2022, 06:28.
Working...
X