Hi guys,
suppose to have the following dataset:
data DB;
input ID :$20.Admission:date9. Discharge:date9. Diagnosis :$20.;
format Admission date9. Discharge date9.;
cards;
0001 06DEC2014 14DEC2014 VIRUS_A
0001 08NOV2020 11NOV2020 FLU
0004 14MAY2014 02JUN2014 FLU
0004 30JUN2015 15AUG2015 FLU
0004 16FEB2019 18FEB2019 VIRUS_A
0005 10AUG2019 11SEPT2019 FLU
....
;
I have to fit a time-series model to estimate the weekly number of hospitalizations for VIRUS_A. The dataset shown is just an example of the real dataset. I don't know how to set the "weekly" from the admission dates I have (I have also discharge dates). The study starts on 2014 but some patients are hospitalized after the start others at different months of the 2014. Moreover, does the week number start from the 01 January? If yes, what's happens if 01 Jan is in the middle of the week?
Apart the practical SAS programming, I also have not clear the theory behind mapping dates to weeks. It's the first time I deal with this data and questions.
Thank you in advance
... View more
Hello,
I used the codes at below to estimate the propensity score and logistic regression for inverse probability weighting.
How can I test the balance of the standardised mean differences before and after adjustment?
How to obtain the synthetic n values derived from weights?
Thanks
/***CREATING PROPENSITY SCORES********/
proc sort data=tab_imput; by _imputation_;run;
proc logistic data=tab_imput desc;
class var1 var2 var3 var4 var5 var6 var7 var8 var9 ;
model mut= var var1 var2 var3 var4 var5 var6 var7 var8 var9/link=logit rsquare ;
output out=denom p=d;
by _imputation_;
run;
proc logistic data=tab_imput desc;
model mut=;
output out=num p=n;
by _imputation_;
run;
proc sort data=tab_imput ;
by anonymat;run;
proc sort data=denom;
by anonymat;run;
proc sort data=num;
by anonymat;run;
data tab_imput_pscore;
merge tab_imput denom num;
by anonymat;
if mut=1 then uw=1/d; else if mut=0 then uw=1/(1-d);
if mut=1 then sw=n/d; else if mut=0 then sw=(1-n)/(1-d);
run;
proc sort data=tab_imput_pscore; by _imputation_;run;
/***PROPENSITY SCORE WEIGHTED OUTCOME MODEL****/
ods graphics on;
proc logistic data=tab_imput_pscore desc;
class mut(ref='no') / param=reference ;
model vif (event='no') = mut/ rsquare clodds=wald lackfit ;
weight sw ;
by _imputation_;
oddsratio mut;
ods output parameterEstimates = ipw_mut ;
run;
ods graphics off;
proc mianalyze parms=ipw_mut ;
modeleffects mut;
ods output parameterEstimates = ipw_mut1;
run;
data ipw_mut2; set ipw_mut1;
OR_est=EXP(ESTIMATE);
LCI_OR=OR_est*EXP(-1.96*STDERR);
UCI_OR=OR_est*EXP(+1.96*STDERR);
run;
proc print data=ipw_mut2;
var Parm OR_est LCI_OR UCI_OR Probt ;
run;
... View more
Good morning.
I'm hoping some can help because I'm out of ideas.
I'm attempting to use ODS Excel to place the page number and number of pages in the footer at a right justify. I've tried the three different methods in the example below. I've done some searching and found some information but can't seem to get it to work.
I get warning messages such as:
WARNING: Apparent symbolic reference R not resolved. WARNING: Apparent symbolic reference P not resolved. WARNING: Apparent symbolic reference N not resolved.
Can anyone give me a hint as to what I may be doing wrong here?
options(sheet_interval = 'none'
sheet_name = 'Sheet Name'
frozen_headers = '2'
row_repeat = '1-2'
suppress_bylines = 'yes'
autofilter = 'all'
pages_fitwidth = '1'
pages_fitheight = '50'
/* print_footer = '&R &P & of &N'*/
/* print_footer = 'Page &P & of &N'*/
print_footer = "Page &R &P of &N"
/* print_footer = "&;LInstitutional Research and Assessment &R Page &P of &N &Z &F"*/
absolute_column_width = '12, 30, 30, 18, 10, 10, 12, 50');
... View more
Hi folks,
I am attempting to read an xlsx file into SAS without SAS doing anything to modify the the variable types or the characters as they appear when viewing the xlsx file in Excel. In other words, if something looks like a date, regardless of how it's stored in the xlsx file (e.g., "11/25/2023"), it'll show up in sas as a character variable as that same value (e.g., "11/25/2023"). In other words, I'd like to replicate what the Import Data wizard in SAS does when it just defines all fields as character, as in the following attributes for one particular column, for example:
type=String
Source Informat=$CHAR29
Len.=29
Output Format=$CHAR29.
Output Informat=$CHAR29.
The code automatically generated from the Import Data wizard when I do this contains the DATALINES4 statement, which I can't use because I can't just fill all of these in, as I'm trying to load the data in without having to look at the contents. I'd be fine, though, if I can define the variable types/lengths/formats/etc., as I know what the variables are and what they'll be named.
How do I do this without having to fill in the DATALINES4 content?
I need to be able to specify the sheet within the Excel workbook in question as well.
Thanks!
... View more