SAS PROC IMPORT

PROC IMPORT OUT= WORK.list
DATAFILE= ".....xlsx"
DBMS=EXCEL REPLACE;
RANGE="Sheet1$";
GETNAMES=YES;
MIXED=NO;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;
RUN;

SQL: Create Table and Bulk Insert

 

CREATE TABLE DFC3
(
xxx VARCHAR(30),
xxx INT ,
xxx VARCHAR(30),
xxx VARCHAR(19),
xxx VARCHAR(6),
xxx INT,
xxx INT ,
xxx VARCHAR(19),
xxx INT ,
x  INT ,
xxx VARCHAR(33),
xx INT ,
x INT ,

)

GO
BULK
INSERT DFC3
FROM 'xxxx.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
SELECT TOP 10 *
FROM DFC3
GO
SELECT *
FROM DFC3
GO

Logistic regression, comparing group means

proc glimmix data=asdf namelen=32;
where disaster_type /*age_desc*/ ne "";
class GROUPING_D_RISK_PT;

model &out
=
GROUPING_D_RISK_PT

/solution ddfm=kr dist=binomial link=logit s STDCOEF ;

lsmeans GROUPING_D_RISK_PT / ilink diff;

output out=gmxout residual=resid;
ods output
ParameterEstimates=kaz1
CovParms=uekawa1
nobs=jeana
ModelInfo=estes
dimensions=diminfo
ConvergenceStatus=concon
FitStatistics=FITSTAT
Diffs=DIF_RESULT
;
run;

Odds ratio using PROC MEANS and a data step

proc means data=amy stackodsoutput mean min max n;
class A B;
var X ;
ods output summary=kaz_mean;
run;

proc transpose data=kaz_mean out=amyt;
by B;
var Mean;run;

data amyt2;
set amyt;
/*http://en.wikipedia.org/wiki/Odds_ratio
test using the set values. This should return odds ratio of 36
col1=0.9;
col2=0.2;
*/

odds_ratio= ( col2/(1-col2)) /(col1/(1-col1)) ;

run;