- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sas coders!
I create a linear regression that looks like this:
I am trying to change the Frequent_Mental_Distress in the Fit plot title to say: Fit Plot for Frequent Mental Distress without any of the underscores, I tried doing IF THEN statements and renaming statements but I don't know if I can use labels to be displayed in the fit plot title. Is that possible? My label would be "Percent of people with Frequent Mental Distress"
Thank you!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
PROC REG DATA=WORK.FIGURE (RENAME=outcomes_adults_mental_distr='Frequent Mental Distress'n)
PLOTS(ONLY) = FITPLOT;
LABEL Marijuana_Use = 'Percent of People Who Used Marijuana 1+ Days out of 30 Days';
'Linear Regression'n:
MODEL 'Frequent Mental Distress'n = Marijuana_Use /
CLM
CLI
ALPHA=0.05;
TITLE "Linear Regression of Frequent Mental Distress and Marijuana Use";
ODS SELECT FitPlot;
RUN;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It is much easier to show where changes to your code may be desired if you show the code you used to make to make the plot.
For one thing there are more than one procedures that do linear regression and they are likely to have some different options.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
My code is:
OPTIONS VALIDVARNAME=ANY;
PROC REG DATA=WORK.FIGURE (RENAME = outcomes_adults_mental_distr = Frequent_Mental_Distress)
PLOTS(ONLY) = FITPLOT;
LABEL Marijuana_Use = 'Percent of People Who Used Marijuana 1+ Days out of 30 Days';
'Linear Regression'n:
MODEL Frequent_Mental_Distress = Marijuana_Use /
CLM
CLI
ALPHA=0.05;
TITLE "Linear Regression of Frequent Mental Distress and Marijuana Use";
ODS SELECT FitPlot;
RUN;
TITLE;
Thank you so much! I thought there was only like two procedures but good to know that there are more!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@kcvaldez98 wrote:
I figured it out, thank you
Great!.
Please post an example of your solution and mark it as an accepted solution. That way others searching this forum, or brought here by a search engine, can benefit from your example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
PROC REG DATA=WORK.FIGURE (RENAME=outcomes_adults_mental_distr='Frequent Mental Distress'n)
PLOTS(ONLY) = FITPLOT;
LABEL Marijuana_Use = 'Percent of People Who Used Marijuana 1+ Days out of 30 Days';
'Linear Regression'n:
MODEL 'Frequent Mental Distress'n = Marijuana_Use /
CLM
CLI
ALPHA=0.05;
TITLE "Linear Regression of Frequent Mental Distress and Marijuana Use";
ODS SELECT FitPlot;
RUN;