David17 Tracker
https://communities.sas.com/kntur85557/tracker
David17 TrackerSat, 20 Apr 2024 22:46:26 GMT2024-04-20T22:46:26ZRe: sgpanel hbox suppress missing categories in a panel
https://communities.sas.com/t5/Graphics-Programming/sgpanel-hbox-suppress-missing-categories-in-a-panel/m-p/887899#M24035
Thanks!Fri, 04 Aug 2023 15:18:01 GMThttps://communities.sas.com/t5/Graphics-Programming/sgpanel-hbox-suppress-missing-categories-in-a-panel/m-p/887899#M24035David172023-08-04T15:18:01Zsgpanel hbox suppress missing categories in a panel
https://communities.sas.com/t5/Graphics-Programming/sgpanel-hbox-suppress-missing-categories-in-a-panel/m-p/887830#M24033
<P>I am trying to create a sgpanel of hbox, organized by 4 physician categories, with boxes for each physician specialty. Each specialty belongs to a single category. So specgp="Family Medicine" only belongs to the SpecCat="General." When I try to create this, SAS tries to put all the specialty options in for all the category panels, when the other 3 categories have no data for that specialty. I want to suppress the output in those other panels where there's no data.</P><P>Also, the number of specialties varies by category. "General" has 3 specialties while "Internal" has 7. I'd like the height of each panel to adjust depending on how many specialties there are. I'd like a different reference line for each panel. This code puts all 4 reference lines in all 4 panels. </P><P>I created some test data with 2 categories and 5 specialties to show what I mean. Thanks in advance. I'm using SAS 9.4.</P><PRE><CODE class="">data phystest;
input speccat $ specgp $ out;
datalines;
General Family 0.2
General Family 0.3
General Family 0
General Family -0.2
General Pediatric 0.1
General Pediatric -0.1
General Pediatric -0.2
General Pediatric -0.5
Internal Surgery -0.5
Internal Surgery -0.7
Internal Surgery -0.8
Internal Surgery -0.9
Internal Cardiology 1.2
Internal Cardiology 1.4
Internal Cardiology 1.7
Internal Cardiology 1.3
Internal Radiology 0.7
Internal Radiology 0.5
Internal Radiology 0.2
Internal Radiology 0.9
Internal Radiology 1.7
;
proc sgpanel data=phystest noautolegend;
panelby speccat / rows=2;
refline 0.25 -0.25 / axis=x label lineattrs=(color=GREEN);
hbox out / category=specgp ;
colaxis grid minor minorcount=4
min=-1 max=2 gridattrs=(color=LIGR);
label speccat="Category" specgp="Specialty";
run;</CODE></PRE><P> </P>Fri, 04 Aug 2023 05:50:12 GMThttps://communities.sas.com/t5/Graphics-Programming/sgpanel-hbox-suppress-missing-categories-in-a-panel/m-p/887830#M24033David172023-08-04T05:50:12ZRe: Exploratory Factor Analysis Interpreting Error Variance and Cumulative Variance
https://communities.sas.com/t5/Statistical-Procedures/Exploratory-Factor-Analysis-Interpreting-Error-Variance-and/m-p/884483#M43805
<P>Sure. I actually started with a polychoric transformation prior to the EFA, to help linearize the responses. This helped the questions group properly, although one of the questions ended up grouping with another factor, which is understandable in context.</P><DIV> </DIV><DIV>* Polychoric Transformation, Step 1;<BR />proc prinqual data=phys out=phys_poly4 plots=transformation<BR />maxiter = 100 standard scores n=4 replace;<BR />where outmiss < 4;<BR />transform monotone (knowi1-knowi5 hes1 hesi2 hesi3 stigi1-stigi3 outi1-outi4);<BR />id record_ID;<BR />run;</DIV><DIV> </DIV><DIV>* Exploratory Factor Analysis, Step 2;</DIV><DIV>proc factor data = phys nfactors = 4 rotate = promax method = ml priors = smc </DIV><DIV><SPAN>scree reorder msa score Heywood residuals </SPAN><SPAN>out=phys_EFA1 outstat=phys_stat plots=all;</SPAN></DIV><DIV><SPAN>where outmiss < 4;</SPAN></DIV><DIV><SPAN>var Tknowi2-Tknowi4 Thes1 Thesi2 Thesi3 Tstigi1-Tstigi3 Touti1-Touti4;</SPAN></DIV><DIV><SPAN>pathdiagram notitle arrange=grip label=[Factor1="Pt Pain Care" Factor2="Knowledge/ Experience"</SPAN></DIV><DIV><SPAN>Factor3="Stigma" Factor4="Hesitancy"];</SPAN></DIV><DIV>run;</DIV><P> </P>Wed, 12 Jul 2023 14:24:12 GMThttps://communities.sas.com/t5/Statistical-Procedures/Exploratory-Factor-Analysis-Interpreting-Error-Variance-and/m-p/884483#M43805David172023-07-12T14:24:12ZExploratory Factor Analysis Interpreting Error Variance and Cumulative Variance
https://communities.sas.com/t5/Statistical-Procedures/Exploratory-Factor-Analysis-Interpreting-Error-Variance-and/m-p/884414#M43801
<P>I'm using proc factor for an exploratory factor analysis for a survey. I have very good loading of two questions onto our "pt pain care factor" (0.79 and 0.80), but the error variances of the individual questions are low (0.28 and 0.37). How should I interpret this and what does this say is going on? This is our outcome factor, so it's important to have right, although we can't really remove any variables. Also, for the cumulative variance explained by the factors, I get 100% of the variance explained for 2 factors in the scree plot. This then goes way above 100% before coming back down to 100% for the last question. (After adjustments, it says 100% is explained by 4 factors.) I had thought this wasn't possible, and I'm not sure what's going on with that, nor how to report the total variance explained by the four factors. The weighted final extracted communalities are 0.78. Is this distinct from the cumulative variance explained by the factors? Should I report the unweighted communalities? Graphic below. Thanks for your assistance.<span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Path and Scree.png" style="width: 999px;"><img src="https://communities.sas.com/t5/image/serverpage/image-id/85728i8B1E6F4249C9165D/image-size/large?v=v2&px=999" role="button" title="Path and Scree.png" alt="Path and Scree.png" /></span> attached.</P>Wed, 12 Jul 2023 00:30:27 GMThttps://communities.sas.com/t5/Statistical-Procedures/Exploratory-Factor-Analysis-Interpreting-Error-Variance-and/m-p/884414#M43801David172023-07-12T00:30:27ZRe: SEM Polychoric Transformation and Exploratory Factor Analysis
https://communities.sas.com/t5/Statistical-Procedures/SEM-Polychoric-Transformation-and-Exploratory-Factor-Analysis/m-p/874711#M43269
<P>Thanks for your help. I'm a little confused, because you say on the one hand that a polychoric transformation would confuse the interpretation, but on the other hand that treating a Likert scale as a continuous variable in EFA/CFA/SEM is useful. There is a SAS procedure which does polychoric transformations of the answers simply, in addition to providing the polychoric correlation matrix:</P><P><STRONG>proc prinqual </STRONG>data=op out=op_prinqual3 plot=all</P><P>maxiter = <STRONG>100 </STRONG>standard scores n=<STRONG>3 </STRONG>replace;</P><P>transform monotone (Dis1-Dis2 Know1-Know4 Yrs4gp OpFreq Stigma1-Stigma8);</P><P>* Maxiter: maximum iternations (default=30);</P><P>* standard: Standardize output to Variance = 1 N=3 means make 3 axes;</P><P>* replace: Replace original values;</P><P>* scores: outputs principal component scores;</P><P>* Transform monotone for ordinal data; * Transform opscore for nominal data;</P><P><STRONG>run</STRONG>;</P><P>So this transforms the Likert answers from the flat 1, 2, 3, 4, 5 to 1.12, 2.28, 2.78, 4.51, 4.94 for example, with different numbers for each question. It's not the correlation matrix, which is also produced. Then, I would input the transformed values into the EFA - something along the lines of this:</P><P><STRONG>proc factor</STRONG> data=op_p3 method=ml rotate=promax corr msa scree residuals preplot plot;</P><P> var DisT1-DisT2 KnowT1-KnowT4 Yrs4gpT OpFreqT StigmaT1-StigmaT8;</P><P> * DisT etc. are the new variables and answers from the polychoric transformation;</P><P><STRONG>run;</STRONG></P><P>From here, assuming they're interretable and grouping as expected, the resultant factors would be used in a General Linear Model analysis. This still allows factor scores to be produced, and I don't think it messes up interpretation at all. Obviously, interpretation is everything for us. Do you think this resolve the interpretation (and other) issues?</P>Tue, 09 May 2023 17:23:46 GMThttps://communities.sas.com/t5/Statistical-Procedures/SEM-Polychoric-Transformation-and-Exploratory-Factor-Analysis/m-p/874711#M43269David172023-05-09T17:23:46ZSEM Polychoric Transformation and Exploratory Factor Analysis
https://communities.sas.com/t5/Statistical-Procedures/SEM-Polychoric-Transformation-and-Exploratory-Factor-Analysis/m-p/874209#M43254
<P>I'm a little new to Structural Equation Modeling (SEM). I am working with a socio-behavioral survey with two latent predictor variables and one latent outcome variable with 3-4 questions each. Almost all the questions are on a 4- or 5-level Likert scale. My questions: 1) It seems like a polychoric transformation of each question would be useful prior to doing Exploratory Factor Analysis (EFA). This would allow us to "de-emphasize" strongly agree and agree, if there's not much difference between those two answers for an individual question, for example. However, several guides I've read seem to skip the polychoric correlation step, even with ordinal variables. Is doing the polychoric transformation first useful, or is it mostly redundant with EFA, mathematically? 2) Are proc prinqual and proc factor the best procedures to use for this, respectively, or would proc calis (or something else) be better? I'm using SAS 9.4. 3) I also have several demographic variables (age, race, location, background) which likely are associated with both the predictor and outcome latent variables. Our primary interest is what factors affect the outcome, but our secondary interest is if the demographic variables also affect the latent predictors. Is it okay to do this in two steps? First, proc GLMselect on the latent outcome followed by looking at the effect of the demographic variables on the latent predictors (separately). Or, is there a way (and is it better) to model this simultaneously? If the latter, how?</P>Fri, 05 May 2023 20:27:44 GMThttps://communities.sas.com/t5/Statistical-Procedures/SEM-Polychoric-Transformation-and-Exploratory-Factor-Analysis/m-p/874209#M43254David172023-05-05T20:27:44Z