BookmarkSubscribeRSS Feed
Arjayita
Obsidian | Level 7
I have one dataset DORMANT_PCA_CC which has fourteen variables. Bu_419_DQ, Bu_26_ab_num, Bu_345_hn_num, rr_chr_105, bu_162_gg_num, rr_chr_169, bu_799_teb_num, rr_chr_111, bu_301_pl_num, bu_1552_shc_num, bu_1577_ric_num, rr_chr_122, e1_b_07, bu_670_uz_num.
i want to drop one variable which is bu_670_uz_num.

If I want to test whether the drop out variable bu_670_uz_num is significant or not, I shall perform a likelihood ratio test of two models. How to write a code on SAS to check the change in likelihood?

thanks in advance
4 REPLIES 4
Arjayita
Obsidian | Level 7

 

LIBNAME dev "/team/decision_science/Customer_Modelling/Project/013_Foundation_Customer_Score/Data/Development Sample/Jun19/Stratified Samples" access=readonly;
LIBNAME MRAV "/team/analytics_mod/Technical_Validation/01_Retail/04_Unsecured/FCS_StageD_Rerun/Data";

data dormant_pca_cc;
    set dev.fcs_jun19_dorm_pca_cc_build;
	drop CSV2_2_exclusion_7_bnkrpt CSV2_2_exclusion_8_dceasd CSV2_2_exclusion_9_basic_dorm
		 bcoms_active_9m_frm_Jun19 bcoms_stays_active_9m_frm_Jun19;
run;

%SYSMSTORECLEAR;
LIBNAME modmacro "/team/decision_science/xTeam/.modelling_macro/" access=readonly;
OPTIONS noimplmac obs=max mstored sasmstore=modmacro;

* Create the bindings dataset *;
DATA bandings;
     LENGTH varname $ 40 grps $ 2000;
     INPUT type modtype inmod varname $ grps $;
CARDS;
2 1 1 BU_419_DQ :"0_","U","ND":
1 1 1 BU_26_AB_NUM :0:
1 1 1 BU_345_HN_NUM :0:25:75:
1 1 1 RR_CHR_105 :200:
1 1 1 BU_162_GG_NUM :120:180:360:
1 1 1 RR_CHR_169 :-9999997:5:30:
1 1 1 BU_799_TEB_NUM :0:1:2:
1 1 1 RR_CHR_111 :2000:
1 1 1 BU_301_PL_NUM :0:
1 1 1 BU_1552_SHC_NUM :.N:0:
1 1 1 BU_1577_RIC_NUM :0:50:
1 1 1 RR_CHR_122 :0:
2 1 1 E1_B_07 :"0","N","T","U":
1 1 1 bu_670_uz_num :-1:1000:
;
RUN;

* Create the dataset labels *;
DATA labels;
     LENGTH varname $ 15 grps $ 300;
     INPUT varname $ grps $;
CARDS;
RUN;


* Execute the model SAS macro *;
%MODEL(
     set=dormant_pca_cc,
     scoreset=MRAV.dormant_pca_cc,
     outcome=FCS_bad_9m_Jun19,
     weight=weight,
     holdout=holdout,
     oscore=CSv2_2,
     drop=1,
     user=Arjayita Ghosh,
     progname=Dormant_PCA_CC
);


Arjayita
Obsidian | Level 7

I have attached the base code for better understanding 🙂

ballardw
Super User

A macro call with a parameter list without the complete definition of the macro as in

%MODEL(
     set=dormant_pca_cc,
     scoreset=MRAV.dormant_pca_cc,
     outcome=FCS_bad_9m_Jun19,
     weight=weight,
     holdout=holdout,
     oscore=CSv2_2,
     drop=1,
     user=Arjayita Ghosh,
     progname=Dormant_PCA_CC
);

Does not really provide much for better understanding.

Some where there is code that starts with

%macro Model(<parameters>);
 
and ends with

%mend;

that describes the macro and we could discuss that.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 666 views
  • 3 likes
  • 3 in conversation