LunaMinerva Tracker
https://communities.sas.com/kntur85557/tracker
LunaMinerva TrackerWed, 11 Sep 2024 23:56:17 GMT2024-09-11T23:56:17ZRe: CLUSTER ANALYSIS: Silhouette plots
https://communities.sas.com/t5/Graphics-Programming/CLUSTER-ANALYSIS-Silhouette-plots/m-p/421837#M14505
<P>And what's the code for that? Or an example I can follow?</P>Sun, 17 Dec 2017 12:18:36 GMThttps://communities.sas.com/t5/Graphics-Programming/CLUSTER-ANALYSIS-Silhouette-plots/m-p/421837#M14505LunaMinerva2017-12-17T12:18:36ZCLUSTER ANALYSIS: Silhouette plots
https://communities.sas.com/t5/Graphics-Programming/CLUSTER-ANALYSIS-Silhouette-plots/m-p/421768#M14502
<P>Hello all.</P><P> </P><P>I can't seem to be able to find the code to get silhouette plots in SAS, to complement my cluster analysis, like <A href="http://scikit-learn.org/stable/auto_examples/cluster/plot_kmeans_silhouette_analysis.html" target="_self">these</A> here. Is there any way to get them using PROC CLUSTER or PROC FASTCLUS? Or do I need a different procedure altogether?</P><P> </P><P>Most other statistical softwares can produce them.</P><P> </P><P>Can anyone help me?</P>Sat, 16 Dec 2017 10:22:43 GMThttps://communities.sas.com/t5/Graphics-Programming/CLUSTER-ANALYSIS-Silhouette-plots/m-p/421768#M14502LunaMinerva2017-12-16T10:22:43ZSAS University Edition and switching from GPLOT to SGPLOT
https://communities.sas.com/t5/Graphics-Programming/SAS-University-Edition-and-switching-from-GPLOT-to-SGPLOT/m-p/410537#M14073
<P>Hello all.</P>
<P> </P>
<P>I just discovered that apparently all my problems are due to the fact that PROC GPLOT doesn't work on SAS UE (very useful indeed! <img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://communities.sas.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" />), and from my searches I think I cannot just switch the name of the procedure, but a different code is required to get the same output as in GPLOT.</P>
<P> </P>
<P>How can I turn the code below in something that would give me the same result in SGPLOT as I would have got with GPLOT?</P>
<P> </P>
<PRE><CODE class=" language-sas">SYMBOL1 i=join V=* C=bib;
SYMBOL2 i=join V=diamond C=RED;
SYMBOL3 i=join V=star C=orange;
SYMBOL4 i=join V=triangle C=green;
SYMBOL5 i=join V=squarefilled C=yellow;</CODE></PRE>
<P>I'm especially interested in the colors and in the right code to have the data points joined.</P>
<P> </P>
<P>Can anyone help me?</P>Sat, 04 Nov 2017 14:55:09 GMThttps://communities.sas.com/t5/Graphics-Programming/SAS-University-Edition-and-switching-from-GPLOT-to-SGPLOT/m-p/410537#M14073LunaMinerva2017-11-04T14:55:09ZRe: PROC TREE with _PROPOR_ as height + graph not working
https://communities.sas.com/t5/Statistical-Procedures/PROC-TREE-with-PROPOR-as-height-graph-not-working/m-p/410115#M21424
<P>So can anyone weigh in on the actual code and help me sort out any errors? I really don't care if my procedures are outdated, it's a university course and this is the procedures the professor taught us; for the time being I just want to learn how to use SAS in general terms, I will have time to care about up-to-date procedures if I will end up using SAS in my work in the future.</P>Fri, 03 Nov 2017 08:31:47 GMThttps://communities.sas.com/t5/Statistical-Procedures/PROC-TREE-with-PROPOR-as-height-graph-not-working/m-p/410115#M21424LunaMinerva2017-11-03T08:31:47ZRe: PROC TREE with _PROPOR_ as height + graph not working
https://communities.sas.com/t5/Statistical-Procedures/PROC-TREE-with-PROPOR-as-height-graph-not-working/m-p/409684#M21394
<P>Can I do those things with the SAS Studio I'm using with a virtual machine? To be honest I'm just following the code examples we were given by the professor...</P>Thu, 02 Nov 2017 00:12:27 GMThttps://communities.sas.com/t5/Statistical-Procedures/PROC-TREE-with-PROPOR-as-height-graph-not-working/m-p/409684#M21394LunaMinerva2017-11-02T00:12:27ZPROC TREE with _PROPOR_ as height + graph not working
https://communities.sas.com/t5/Statistical-Procedures/PROC-TREE-with-PROPOR-as-height-graph-not-working/m-p/409667#M21392
<P>Hi everyone.</P><P> </P><P>I'm doing a cluster analysis as part of an assignment, and I want the output tree to have as the height not the standard "number of clusters", but the proportion of variance explained. I'm using the code I found <A href="http://documentation.sas.com/?docsetId=statug&docsetVersion=14.3&docsetTarget=statug_tree_gettingstarted.htm&locale=en" target="_self">here</A>, but I can't get it to work and I keep getting only the number of clusters tree.</P><P> </P><P>Moreover, as I want to perform different types of hierarchical clustering in order to compare the results, I put in some code to get a plot of the Rsquared against the number of clusters and get a curve for each of the methods used, but I can't get it to work.</P><P> </P><P>What am I getting wrong? My code is as follows:</P><P> </P><PRE><CODE class=" language-sas">DATA sports;
INPUT SPORT$ END STR PWR SPD AGI FLX NER DUR HAN ANA;
DATALINES;
Soccer 2.88 4.5 3.13 1.13 1.63 2.63 2.75 2.13 6.63 3.25
Curling 5.88 3.5 2.63 1.63 2.75 1.75 9.88 4.38 8 7.5
(...)
;
PROC PRINT DATA=sports;
PROC UNIVARIATE;
PROC CLUSTER SIMPLE NOEIGEN METHOD=SIMPLE RMSSTD RSQUARE NONORM OUTTREE=singleout;
id SPORT;
var END STR PWR SPD AGI FLX NER DUR HAN ANA;
proc sort; by _ncl_;
PROC CLUSTER COMPLETE NOEIGEN METHOD=COMPLETE RMSSTD RSQUARE NONORM OUTTREE=completeout;
id SPORT;
var END STR PWR SPD AGI FLX NER DUR HAN ANA;
proc sort; by _ncl_;
PROC CLUSTER CENTROID NOEIGEN METHOD=CENTROID RMSSTD RSQUARE NONORM OUTTREE=centroidout;
id SPORT;
var END STR PWR SPD AGI FLX NER DUR HAN ANA;
proc sort; by _ncl_;
PROC CLUSTER WARD NOEIGEN METHOD=WARD RMSSTD RSQUARE NONORM OUTTREE=wardout;
id SPORT;
var END STR PWR SPD AGI FLX NER DUR HAN ANA;
proc sort; by _ncl_;
PROC TREE DATA=singleout; height _propor_;
PROC TREE DATA=completeout; height _propor_;
PROC TREE DATA=centroidout; height _propor_;
PROC TREE DATA=wardout; height _propor_;
DATA SINGLEOUT; SET SINGLEOUT; SINGLE=_RSQ_;
DATA COMPLETEOUT; SET COMPLETEOUT; COMPLETE=_RSQ_;
DATA CENTROIDOUT; SET CENTROIDOUT; CENTROID=_RSQ_;
DATA WARDOUT; SET WARDOUT; WARD=_RSQ_;
DATA OUTPUTS; MERGE SINGLEOUT COMPLETEOUT CENTROIDOUT WARDOUT; BY _NCL_;
DATA OUTPUTS; SET OUTPUTS; IF _NCL_<11;
SYMBOL1 I=JOIN V=S L=15 C=BLACK;
SYMBOL2 I=JOIN V=P L=10 C=RED;
SYMBOL3 I=JOIN V=C L=2 C=BLUE;
SYMBOL4 I=JOIN V=W L=1 C=GREEN;
PROC GPLOT DATA=OUTPUTS;
PLOT SINGLE*_NCL_=1 COMPLETE*_NCL_=2 CENTROID*_NCL_=3 WARD*_NCL_=4 /OVERLAY LEGEND;</CODE></PRE>Wed, 01 Nov 2017 22:39:09 GMThttps://communities.sas.com/t5/Statistical-Procedures/PROC-TREE-with-PROPOR-as-height-graph-not-working/m-p/409667#M21392LunaMinerva2017-11-01T22:39:09ZRe: Creating a conditional variable starting from a non-numerical variable
https://communities.sas.com/t5/SAS-Programming/Creating-a-conditional-variable-starting-from-a-non-numerical/m-p/400265#M97031
<P>Ok, so I just tried putting the city names between apostrophes and it does work because I'm finally getting the CITYNR column I was looking for with the correct numbers, but I'm also still getting empty columns for each city name. What else am I getting wrong?</P>Mon, 02 Oct 2017 14:08:32 GMThttps://communities.sas.com/t5/SAS-Programming/Creating-a-conditional-variable-starting-from-a-non-numerical/m-p/400265#M97031LunaMinerva2017-10-02T14:08:32ZCreating a conditional variable starting from a non-numerical variable
https://communities.sas.com/t5/SAS-Programming/Creating-a-conditional-variable-starting-from-a-non-numerical/m-p/400261#M97029
<P>Hello all.</P><P> </P><P>I'm getting started with SAS and I need a conditional variable starting from a non-numerical variable. My dataset looks like this:</P><P> </P><P>CITY $ var2 var3</P><P>London . . </P><P>London . .</P><P>New York . . </P><P>Madrid . .</P><P> </P><P>I'm using the IF THEN command in order to get the system to create a new numerical variable starting from the city names (IF CITY=London THEN CITYNR=1; <SPAN>IF CITY=Madrid THEN CITYNR=2; etc), but I can't bring the code to work. The output table has new columns for CITYNR, LONDON, MADRID, etc, which is of course something I don't want. Just for the sake of it I tried the same command starting from a numerical variable like var2 or var3 and it works.</SPAN></P><P> </P><P><SPAN>What am I getting wrong? Can anyone help me? Thank you so much!</SPAN></P>Mon, 02 Oct 2017 13:58:53 GMThttps://communities.sas.com/t5/SAS-Programming/Creating-a-conditional-variable-starting-from-a-non-numerical/m-p/400261#M97029LunaMinerva2017-10-02T13:58:53Z