Howdy!
If I specify a font size in SGPLOT, SAS does not seem to actually produce that font size in ODS PDF. It seems to produce some larger font size. Here's example code.
ods pdf file = "M:\test.pdf";
ods graphics on / reset;
title1 height = 12pt font = 'Arial' 'Title 1';
title2 height = 11pt font = 'Arial' 'Title 2';
title3 height = 10pt font = 'Arial' bold 'Title 3';
footnote1 height = 9pt font = 'Arial' 'Footnote 1';
footnote3 height = 8pt font = 'Arial' 'Footnote 2';
proc sgplot data = sasHelp.class; series x = name y = age; xAxis valueAttrs = (family = 'Arial' size = 9.5pt); run;
proc sgplot data = sasHelp.class; series x = name y = age; xAxis valueAttrs = (family = 'Arial' size = 10pt); run;
proc sgplot data = sasHelp.class; series x = name y = age; xAxis valueAttrs = (family = 'Arial' size = 10.5pt); run;
proc sgplot data = sasHelp.class; series x = name y = age; xAxis valueAttrs = (family = 'Arial' size = 11pt); run;
proc sgplot data = sasHelp.class; series x = name y = age; xAxis valueAttrs = (family = 'Arial' size = 11.5pt); run;
proc sgplot data = sasHelp.class; series x = name y = age; xAxis valueAttrs = (family = 'Arial' size = 12pt); run;
ods pdf close;
Title1 comes out as 13 pt. Title2 as 11.5 pt.
Title3 as 11 pt.
Footnote1 as 9.5 pt.
Footnote2 as 9 pt.
The x-axis tick values come out as 9.5, 11, 11, 11.5, 11.5, and 13 pt. respectively.
If I add noGTitle and noGFootnote to the ODS PDF statement, then the font sizes for the titles and footnotes are correct. It seems the problem is with the graphic procedure itself.
I checked the font sizes by copying the text from the PDF and pasting into Word. I am fairly certain the same happens with ODS RTF; I can't paste the text into Word, but eyeballing it, it looks the same. Attached are the PDF and RTF outputs each way, plus a screenshot of the side-by-side comparison of the two RTF files showing that the font without noGTitle definitely is bigger than the font with noGTitle.
Does anyone else also get this? I tested on a SAS session with no other options, custom configuations, etc. but maybe there's still something set on my machine that is messing it up.
Best regards,
Michael
... View more
As I recently posted here, I'm trying to create Table 1 for a research journal article. @Reeza pointed me to the Table 1 macro "TableN" and it looks like exactly what I need.
I downloaded the macro and ran it, and then I tried to call it based on the example provided.
/*Example macro call*/
/*%tablen(data=example, by=arm,
var=age date_on sex race1 smoke_st num_met,
type=1 3 2, outdoc=~/ibm/example1.rtf);*/
/*My version*/
%tablen(data=have, by=TM_group,
var=DEM_AGE DEM_SEX,
type=2 2, outdoc="C:\data_output\test.rtf);
But I got an error after "by TM_group": ERROR: All positional parameters must precede keyword parameters. I looked up the error and it has something to do with the commas between the parameters. After some trial and error of deleting commas, I got it to run without error, but it doesn't produce any output.
Sample data is provided below:
data have;
infile datalines dsd dlm=',' truncover;
input DEM_AGE DEM_SEX cohort_flag TM_group;
datalines;
3,1,1,0
2,1,1,1
3,2,1,1
3,2,1,1
3,2,1,0
2,2,1,1
2,1,1,1
3,1,1,1
2,1,1,1
3,2,1,0
2,1,1,0
2,2,1,1
3,2,1,0
2,2,0,
3,2,1,1
3,2,1,1
3,1,1,0
3,2,1,0
2,1,1,0
3,1,1,1
3,2,1,1
3,2,1,0
3,2,1,1
3,2,1,1
3,2,1,1
; RUN;
proc format library=temp;
value age2grp
1='1:Age Group <65'
2='2:Age Group [65,75)'
3='3:Age Group >=75'
.='Inapplicable/Missing';
value sex
.='Inapplicable/Missing'
1='1:Male'
2='2:Female'
value yesfmt
1='1:Yes'
2='2:No'
.='Inapplicable/Missing'
;
RUN;
... View more
Does anyone know how to calculate odds ratio in its original scale from the coefficient and/or odds ratio from a logistic regression model which includes a natural log transformed independent variable? For example, logit (p/(1-p)) = b0+ b1 In (x) If b1=0.1, (b1 is the coefficient of natural log transformed independent variable) What is the OR for one unit increase in the natural log of x? What is the OR for one unit increase in original scale of X? What is the OR for 5-unit increase in natural log of x? What is the OR for 5-unit increase in X?
... View more
Anyone can help with following question? Thanks. In the logistic regression model, b1 is the coefficient of natural log transformed variable x, it is not the coefficient of original scale of x. logit (p/(1-p)) = b0+ b1 In (x) If b1=0.1, What is the OR for one unit increase in the natural log of x (e^0.1)? What is the OR for one unit increase in original scale of X? What is the OR for 5-unit increase in natural log of x ( ? What is the OR for 5-unit increase in X?
... View more