Introduction
Best attempt at a "good" question that meets the standards of StataList. Perhaps this is as much an attempt to meet the very high standards of StataList as it is an attempt to get input on implementing radar plots in new ways. After reading the advice on posting I wasn't sure about the following . . .
I am in search of a way to implement radar plots. I'm aware of the parplot package but I really am in search of radar plotting. Radar plotting is a style of plotting my audience is used to. For the present use case(s), I'd like to provide what the audience is looking for. I'd rather avoid teaching my audience a new plot type.
Also I found the radar package. It seems to do a nice job at plotting a categorical y (such as automobile make) and a continuous x (automobile weight). In this example the data has one observation for each make. The data includes an entry for that make's weight:
(Example taken from: -help radar- (if installed)).
Question / Goal In Mind
Below is code with comments that seeks to illustrate two other potential use cases. The first would plot a categorical y (such as a series of factor scores) and a continuous x (which would be that factor score's mean). Bonus on this one if the plot could include confidence intervals.
The second would be to plot a categorical y (such as responses on a Likert-like scale) and a continuous x (such as the number of responses in each categorical / ordinal). This implementation could essentially be thought of as a histogram plotted as a radar.
Any advice??
Best attempt at a "good" question that meets the standards of StataList. Perhaps this is as much an attempt to meet the very high standards of StataList as it is an attempt to get input on implementing radar plots in new ways. After reading the advice on posting I wasn't sure about the following . . .
- FAQ 3: Searched around and I did not find the implementation I'm looking for. I may have missed it. Please feel free to point me in the right direction if this has already been addressed.
- FAQ 7: My topic is about radar plotting. I left the title broad because I see there is already at least one implementation of radar plots. But, it doesn't implement the plot in the manner I am seeking.
- FAQ 11: I'm using the latest version of Stata.
- FAQ 12.1/12.5: The code (which is self-contained) below indicates the code I'm using. The code also generates data to test and use. I'm posting two pngs that illustrate the final result I am seeking. This section of the FAQ is unclear about posting PNGs as attachments. 12.4 says okay to use .png / but 12.5 says no attachments. I'm posting the PNGs via link to another site. Hope that is okay.
- FAQ 14: Running Windows 10. Sometimes running Mac OS. I think this question would be mostly independent of OS.
I am in search of a way to implement radar plots. I'm aware of the parplot package but I really am in search of radar plotting. Radar plotting is a style of plotting my audience is used to. For the present use case(s), I'd like to provide what the audience is looking for. I'd rather avoid teaching my audience a new plot type.
Also I found the radar package. It seems to do a nice job at plotting a categorical y (such as automobile make) and a continuous x (automobile weight). In this example the data has one observation for each make. The data includes an entry for that make's weight:
Code:
sysuse auto radar make weight if foreign
Question / Goal In Mind
Below is code with comments that seeks to illustrate two other potential use cases. The first would plot a categorical y (such as a series of factor scores) and a continuous x (which would be that factor score's mean). Bonus on this one if the plot could include confidence intervals.
The second would be to plot a categorical y (such as responses on a Likert-like scale) and a continuous x (such as the number of responses in each categorical / ordinal). This implementation could essentially be thought of as a histogram plotted as a radar.
Any advice??
Code:
set more off clear all // FIRST: Potential implementation of radar plot. // Plot the means of a series of factor scores. // This implementation would be useful for social // sciences each factor score is an outcome on any // given psychometric measurement. set obs 1000 set seed 123456 gen factor_a = rnormal(20,1.12) // Fictional factor score gen factor_b = rnormal(30,1.25) // Fictional factor score gen factor_c = rnormal(22,1.85) // Fictional factor score gen factor_e = rnormal(26,.756) // Fictional factor score gen factor_f = rnormal(28,1.32) // Fictional factor score sum factor*, sep(0) // Display factor score means * facradar factor* // Imaginary/hypothetical/proposed syntax // See for example: https://raw.githubusercontent.com/adamrossnelson/HelloWorld/master/SocRadar.PNG // Bonus points if confidence intervals could also be included in the plot clear all // SECOND: Potential implementation of radar plot. // Plot the frequency, density, or percent distribution // of a categorical and/or ordinal response on a single // variable. Essentially a histogram in radar format. set obs 1000 set seed 123456 gen scale_response = round(rnormal(3,1.5)) // Fictional scale responses replace scale_response = 5 if scale_response > 5 replace scale_response = 5 if scale_response < 1 label define WANT 1 "Much want RADAR" 2 "Sorta want RADAR" 3 "Want RADAR" 4 "Hate RADAR" 5 "Am RADAR" label values scale_response WANT tab scale_response hist scale_response, discrete * histradar scale_response // Imaginary/hypothetical/proposed syntax // See for example: https://raw.githubusercontent.com/adamrossnelson/HelloWorld/master/HistRadar.PNG
Comment