<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Trend line in Gplot in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Trend-line-in-Gplot/m-p/713935#M34506</link>
    <description>&lt;P&gt;"Flopped" is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the "&amp;lt;&amp;gt;" to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the "&amp;lt;&amp;gt;" icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In Proc Gplot when use a plot request like:&lt;/P&gt;
&lt;PRE&gt;plot Reg*Base_Hba Reg*FolHba/overlay;&lt;/PRE&gt;
&lt;P&gt;Reg would be the Y, vertical axis, variable. Is that what you intend?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most plot options are controlled by SYMBOL statements to indicate connected, smoothed or regessed line values depending on Interpolation options. The default symbol statements are mostly intended for scatter plots.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which is one reason to consider &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;'s suggestion because you specify the type of plot up front: Scatter, Series, Regression along with options not possible in Gplot at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am going to guess that maybe something along these lines:&lt;/P&gt;
&lt;PRE&gt;proc Sgplot data=gp2;
  Scatter x=Base_Hba y=FolHba/ group=reg;
run;&lt;/PRE&gt;
&lt;P&gt;If you intend connected lines that would be Series plot with the same syntax. However you likely want to sort your data by Reg and the X axis variable. Otherwise the order of values makes for strange plots.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jan 2021 15:43:01 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-01-25T15:43:01Z</dc:date>
    <item>
      <title>Trend line in Gplot</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Trend-line-in-Gplot/m-p/713887#M34494</link>
      <description>&lt;P&gt;Hi Experts,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May I know how to create a trend line for the given dataset.&lt;/P&gt;
&lt;P&gt;It should be categorized by Regression column following by Hba values&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data samp;
input Reg Base_Hba FolHba;
cards;
1 7.8 6.7
2 10.3 7
1 7.9 8.4
1 9.9 9.5
2 10.7 7.8
1 9.5 8
1 11.2 9.6
2 10.3 9.1
1 5.6 5.7
1 5.6 7
1 9	8.8
2 11 8.8
2 15.2 7.8
2 9.1 6.3
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*I have tried the below code but flopped*/&lt;BR /&gt;proc gplot data=gp2;
plot Reg*Base_Hba Reg*FolHba/overlay;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks in advance;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 13:23:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Trend-line-in-Gplot/m-p/713887#M34494</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2021-01-25T13:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Trend line in Gplot</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Trend-line-in-Gplot/m-p/713888#M34495</link>
      <description>&lt;P&gt;This is a very unclear request, but maybe this example is what you want?&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=graphref&amp;amp;docsetTarget=n14ofpm2yqe0mjn1lerq7zbkznu7.htm&amp;amp;locale=en"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=graphref&amp;amp;docsetTarget=n14ofpm2yqe0mjn1lerq7zbkznu7.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If not, please explain in more detail, what "&lt;SPAN&gt;Regression column following by Hba values" means.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, please consider using the more recent procedure PROC SGPLOT for plotting, it has more features and (usually) a simpler syntax.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 13:23:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Trend-line-in-Gplot/m-p/713888#M34495</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-25T13:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Trend line in Gplot</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Trend-line-in-Gplot/m-p/713935#M34506</link>
      <description>&lt;P&gt;"Flopped" is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the "&amp;lt;&amp;gt;" to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the "&amp;lt;&amp;gt;" icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In Proc Gplot when use a plot request like:&lt;/P&gt;
&lt;PRE&gt;plot Reg*Base_Hba Reg*FolHba/overlay;&lt;/PRE&gt;
&lt;P&gt;Reg would be the Y, vertical axis, variable. Is that what you intend?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most plot options are controlled by SYMBOL statements to indicate connected, smoothed or regessed line values depending on Interpolation options. The default symbol statements are mostly intended for scatter plots.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which is one reason to consider &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;'s suggestion because you specify the type of plot up front: Scatter, Series, Regression along with options not possible in Gplot at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am going to guess that maybe something along these lines:&lt;/P&gt;
&lt;PRE&gt;proc Sgplot data=gp2;
  Scatter x=Base_Hba y=FolHba/ group=reg;
run;&lt;/PRE&gt;
&lt;P&gt;If you intend connected lines that would be Series plot with the same syntax. However you likely want to sort your data by Reg and the X axis variable. Otherwise the order of values makes for strange plots.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 15:43:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Trend-line-in-Gplot/m-p/713935#M34506</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-25T15:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Trend line in Gplot</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Trend-line-in-Gplot/m-p/713948#M34507</link>
      <description>&lt;P&gt;Also, what exactly do you mean by a "trend line"? Elsewhere you use the word "regression", but a "trend line" and "regression line" don't have to be the same thing.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 15:53:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Trend-line-in-Gplot/m-p/713948#M34507</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-25T15:53:17Z</dc:date>
    </item>
  </channel>
</rss>

