-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Charts and Graphs #14
Comments
@ecn310/diop A pie chart is good for understanding each variable on its own. At this point, you need to start using stats / visuals that link together the key variables in your hypothesis. Dylan or I are happy to help brainstorm this if you're not sure how to get started. |
Frequency Histogram of pz216 (r years of education)
Description: This is a frequency histogram that displays pz216 (r years of education). I believe this will be helpful to visually demonstrate the range of years of schooling that the respondents of our data have received. This will also help to put into context the way the bar graph above spikes at 12 years of schooling. Updated x-axis labels
|
pz261 (pw Alzheimer's) over pz216 (r years of education)
Description: This is a bar graph similar to the dementia bar graph created above. This graph shows the respondents who answered "yes" to having Alzheimer's over the number of years of schooling they received. Similarly to the dementia graph, this bar graph also has a major spike at 12 years of education, which I believe makes sense considering the frequency histogram of pz216. |
@abigailmondin You might want to consider making a graph that has two bars for each category: one for the people with dementia and one for the people without. I think you'd take out the "if" statement and add another "over( )" for the pz261 variable, but I'm not 100% on that. |
@abigailmondin Here's some code that I think should help (it's from ChatGPT, so buyer beware):
|
@abigailmondin I think you need |
@kbuzard Thank you for catching that! I believe you were correct about the red bars being five times higher than the blue bars. I've corrected the code, created and attached the correct graph, and added an update to the description. |
pd554 (get lost in familiar places) over pc273 (ever had dementia)
Description: Similar to the previous graph, this is a bar graph that shows pd554 (get lost in familiar places) separated into those who responded "yes" and those who responded "no" over pz273 (ever had dementia). The biggest spike seen on the graph is those who responded "yes" to both ever having dementia and "yes" to getting lost in familiar places. I included the codebook for pc273 to help understand what the values 1, 3, 4, 5, 8, and 9 across the bottom of the graph are referring to.
Potential fix (based on feedback)@kbuzard Are these the kind of changes you were suggesting we make to the graphs? I used the graph editor to make these changes because I really struggled to find code that would do the kind of thing we discussed. If this isn't what you were thinking, would you be able to help me find a way to accomplish what the graph should ideally look like? |
pv009 (forgetful during daily activities) over pc273 (ever had dementia)
Description: Similar to the previous graph, this bar graph shows pv009 (forgetful during daily activities) separated into those who responded "yes" and those who responded "no" over pc273 (ever had dementia). The largest spike in this graph is those who responded "no" to being forgetful during daily activities and "no" to ever having dementia. There is also a significant spike at those who responded "yes" to being forgetful during daily activities and "yes" to ever having dementia. I included the codebook again for the variable pc273 to help understand the values 1, 3, 4, 5, 8, and 9 across the bottom of the graph.
|
pc272 ever had alzheimers over pz216 years of educationcode /* generate pc272_yes = 0 |
pc272 ever had alzheimers over pb014 highest level of educationCode generate pc272_yes = 0 scale for responses |
Updated graphs (still not 100% perfect)pd554 (get lost in familiar places) over pz216 (r years of education)
pv009 (forgetful during daily activities) over pz216 (r years of education)
pd554 (get lost in familiar places) over pc273 (ever had dementia)
pv009 (forgetful during daily activities) over pc273 (ever had dementia)
Overall update: I developed the code for the changes that I had made using the graph editor. @kbuzard or @eldreddyl
I've included all of the code I wrote to produce each graph for your reference, hopefully we can figure this out. |
@eldreddyl Can you help @abigailmondin with this? I have to concentrate on giving feedback on everyone's analysis sections and writing two exams so am unlikely to have time until the weekend. |
@abigailmondin Could you attach a screenshot of the error message? |
@eldreddyl Here is the screenshot of the error message I get when trying to use |
So I played around with the code and read through the 'graph bar' documentation. To me, it doesn't seem like 'xtitle' is supported for bar graphs. You can try two other options. I think either would work, so it may be up to your preference
Give that a try and let me know if Stata is still giving you trouble While you do that, I'll look into the pc273 cutoff issue |
@abigailmondin So I ran your code to generate the pc273 graphs. At least when I ran it, the labels weren't cutoff. I don't think its a Stata issue. I would look into your method of saving the images. You could
|
@eldreddyl When I re-run the code for the pc273 graphs the labels are still cutoff. Is it possible there is a different issue? |
@abigailmondin what method are you using to save them? |
@eldreddyl I'm clicking the save icon, making it a png, and saving them to a folder. But even when I just run the code without saving them the labels are cutoff. |
-------------+--------------------------------------------------
The observation is the amount of people that were looked at within the data. The mean means that on average people have around 12.7 years of education. Standard deviation is how close the results are as compared to the mean which I believe means that some participants have 3 years less than or more than 12.7 years of education. The varoable max means the ever had 1 500 2.43 2.43 Total 20,601 100.00 This numbers correlate to the responses of people within the data. Tabulation is a compilation of results within the data which highlights the relationship between education and dementia as most people answered no. Frequency and percentage speak to how many people have dementia within the data set. . pwcorr pz216 pc273, sig
Pwcorr can be used as a connection between the two variables. The p-value is 0.000. Since this is less than 0.05, the correlation between these two variables is statistically significant. The correlation coefficient measurement ranges from -1 to 1, -1 states there is a perfect negative relationship, 0 symbolizes there is no relationship, and 1 demonstrates a perfect positive relationship. Summarize and tab1 provide background for pwcorr and help with the interpretation. |
@xorabear Remember that you need to ask for the significance level of the correlation, so you need to add ", sig" to the end of the pwcorr command. |
@xorabear tabulating the education variable is the same as a graph you already have, and it is harder to read than looking at the graph, so I suggest you only keep the graph. The results of summarize (and maybe also including a median) would be good to include in your data section. summarize on the dementia variable gives you statistics that are not really meaningful; the average of the codes that represent different answers doesn't mean anything. the key information in tabulate is useful for this variable, that is, we see that someone identifying as having dementia is quite rare. |
@eldreddyl I'm still unable to see the labels when I run the code. If you are able to see the labels, is there any way you could save them or screenshot them and attach them here? |
@abigailmondin For the purposes of your project, it would be better for your group if you submitted the cutoff-label graphs vs having me attach them. That way you won't lose as many points on the reproducibility section of the rubric. Here are some other options in the meantime:
|
Here we want to upload any charts or graphs we create (ex. pie charts, histograms, etc.). You may want to include a description, brief analysis, or explain the importance of the chart/graph.
The text was updated successfully, but these errors were encountered: