Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A sample of 3000 clients have already been contacted. The data is in the le ps2.sas7bdat. The variables description is in the Appendix. Appendix -

image text in transcribedimage text in transcribed

A sample of 3000 clients have already been contacted. The data is in the le ps2.sas7bdat.

The variables description is in the Appendix.

Appendix - variable description for Problem 1

Input variables:

1. age (numeric)

2. job : type of job (categorical: "admin.","unknown","unemployed","management","housemaid","entrepreneur",

"student", "blue-collar","self-employed","retired","technician","services")

3. marital : marital status (categorical: "married","divorced","single"; note: "divorced" means divorced

or widowed)

4. education (categorical: "unknown","secondary","primary","tertiary")

5. default: has credit in default? (binary: "yes","no")

6. balance: average yearly balance, in euros (numeric)

7. housing: has housing loan? (binary: "yes","no")

8. loan: has personal loan? (binary: "yes","no")

9. contact: contact communication type (categorical: "unknown","telephone","cellular")

10. day: last contact day of the month (numeric)

11. month: last contact month of year (categorical: "jan", "feb", "mar", ..., "nov", "dec")

12. duration: last contact duration, in seconds (numeric)

13. pdays: number of days that passed by after the client was last contacted from a previous campaign

(numeric, -1 means client was not previously contacted)

14. previous: number of contacts performed before this campaign and for this client (numeric)

15. poutcome: outcome of the previous marketing campaign (categorical: "unknown","other","failure","success")

Output variable (desired target):

1. Y - has the client subscribed to a term deposit? (binary: 1="yes",0="no")

First I know I need to put in dummy variables, but the problem is that I don't know if I did the right thing on SAS. I transformed the data to numerical values like this;

data train;set econ324.ps2;x1=age;x21=0; if job="admin." then x21=1;x22=0; if job="unemployed" then x22=1;x23=0; if job=" unknown" then x23= 1;x24=0; if job="management" then x24=1;x25=0; if job="housemaid" then x25=1;x26=0; if job="entrepreneur" then x26=1;x27=0; if job="student" then x27=1;x28=0; if job="blue-collar" then x28=1;x29=0; if job="self-employed" then x29=1;x210=0;if job= "retired" then x210=1;x211=0;if job="technician" then x211=1;x212=0;if job="services" then x212=1;x31=0; if marital="married" then x31=1;x32=0; if marital= "divorced" then x32=1;x33=0; if marital="single" then x33=1;x41=0; if education="unknown" then x41=1;x42=0; if education="secondary" then x42=1;x43=0; if education="primary" then x43=1;x44=0; if education="tertiary" then x44=1;x51=0; if default="yes" then x52=1;x52=0; if default="no" then x52=0;x6=balance;x71=0; if housing="yes" then x71=1;x72=0; if housing="no" then x72=0;x81=0; if loan="yes" then x81=1;x82=0; if loan="no" then x82=0;x91=0; if contract="unknown" then x91=1;x92=0; if contract="telephone" then x92=1;x93=0; if contract="cellular" then x93=1;x10=day;x111=0;if month="january" then x111=1;x112=0;if month=" february" then x112=1;x113=0;if month="march" then x113=1;x114=0;if month="april" then x114=1;x115=0;if month="May" then x115=1;x116=0;if month="June" then x116=1;x117=0;if month=" July" then x117=1;x118=0;if month="August" then x118=1;x119=0;if month="September" then x119=1;x1110=0;if month="October" then x1110=1;x1111=0;if month="November" then x1111=1;x1112=0;if month="december" then x1112=1;x13=pday;x14=previous;x151=0; if poutcome=" unknown" then x151=1;x152=0; if poutcome="other" then x152=1;x153=0; if poutcome="failure" then x153=1;x154=0; if poutcome="success" then x154=1;run;

The second step is to put this to ctable, but I can't run the code.

proc logistic data= work.train;model y =x1 x21-x211 x31-x32 x41-x43 x51 x6 x71 x81 x91-x92 x10 x111-x1111 x13 x14 x151-x153/ctable;run;

I don't where I did wrong, for proc logistic, you see above the code. Is it the first code is wrong?

Below, it is the table I transformed using the first code, the problem is I need to put a check mark all the dummies variables I created it. I am not sure, if the first code has a problem because I need this table to run ctable. Second picture, it the ctable, that I couldn't run it.

image text in transcribedimage text in transcribed
X F -> C D odamid-usw2.oda.sas.com/SASStudio/main?locale=en_CA&zone=GMT-04%253A00&https%3A%2F%2Fodamid-usw2.oda.sas.com%2FSASStudio%2Findex= SAS Studio SAS Programmer Sign Out 1 7 *ps1_g x ps2.sas7bdat * *ASSIGNMENT 2.sas x _ *Program 1.sas x : prepare_DBM.sas * [ *ASSIGNMENT 2.sas~ x : selection3_cv.sas x WORK.TRAIN x x *Program 1 x CODE LOG RESULTS - Errors, Warnings, Notes Errors (152) D A Warnings Notes (2) EKKUK : variable xlob Ill SUTTIx List not In dala set. ERROR: Variable x187 in suffix list not in data set. ERROR: Variable x188 in suffix list not in data set. ERROR: Variable x189 in suffix list not in data set. ERROR: Variable x190 in suffix list not in data set. ERROR: Variable x191 in suffix list not in data set. ERROR: Variable x192 in suffix list not in data set. ERROR: Variable x193 in suffix list not in data set. ERROR: Variable x194 in suffix list not in data set. ERROR: Variable x195 in suffix list not in data set. ERROR: Variable x196 in suffix list not in data set. ERROR: Variable x197 in suffix list not in data set. ERROR: Variable x198 in suffix list not in data set. ERROR: Variable x199 in suffix list not in data set. ERROR: Variable x200 in suffix list not in data set. ERROR: Variable x201 in suffix list not in data set. ERROR: Variable x202 in suffix list not in data set. ERROR: Variable x203 in suffix list not in data set. ERROR: Variable x204 in suffix list not in data set. ERROR: Variable x205 in suffix list not in data set. ERROR: Variable x206 in suffix list not in data set. ERROR: Variable x207 in suffix list not in data set. ERROR: Variable x208 in suffix list not in data set. ERROR: Variable x209 in suffix list not in data set. NOTE: The SAS System stopped processing this step because of errors. 73 proc logistic data= train; 74 model y (ref'0' )=x1 x21-x211 x31-x32 x41-x43 x51 x6 x71 x81 x91-x92 x10 xill-xlil1 x13 x14 x151-x153/ctable; 73 ERROR 73-322: Expecting an =. 75 run; 76 77 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 89 Messages: 4 User: u54888767 Type here to search O W ENG 6:38 PM O INTL 4/16/2021X - - C D odamid-usw2.oda.sas.com/SASStudio/main?locale=en_CA&zone=GMT-04%253A00&https%3%2F%2Fodamid-usw2.oda.sas.com%2FSASStudio%2Findex= SAS Studio SAS Programmer Sign Out 1 71 *ps1_g x ps2.sas7bdat * *ASSIGNMENT 2.sas * ! *Program 1.sas * ! prepare_DBM.sas * *ASSIGNMENT 2.sas~ x : selection3_cv.sas x WORK.TRAIN x x *Program 1 x View: Column names Filter: (none) Columns Total rows: 3000 Total columns: 67 Rows 1-100 Select all x1 x21 x22 x23 x24 O 123 day 1 26 0 0 0 A month 2 60 0 O O 0 123 duration 1 W 47 o o o o 4 0 123 pdays 31 - o O 5 1 123 previous 26 o o o o 6 0 56 0 A poutcome 31 O Ay o o o o 6 00 41 123 x 1 32 o 123 x21 o o o o o o O O 10 32 o o - 123 X22 11 46 ooo V 123 x23 o o o o o O O O O O O O O O O O O O 12 29 123 X24 13 0 52 o o 123 x25 14 o 38 15 0 26 Value o o o o Property 16 O 45 Label job 17 0 31 o Name job 18 0 56 o o - Length 13 o o 19 0 34 o o o o o o o o - Type Char 20 0 37 Format $13. o o 21 1 20 Informat $13. 22 0 oooo o 29 ooo o o O 23 0 26 24 0 35 O Messages: 4 User: u54888767 Type here to search O N ENG 6:53 PM O INTL 4/16/2021

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Managerial Economics and Business Strategy

Authors: Michael Baye, Jeff Prince

9th edition

9781259896422, 1259290611, 1259896420, 978-1259290619

More Books

Students also viewed these Economics questions

Question

Determine miller indices of plane A Z a/2 X a/2 a/2 Y

Answered: 1 week ago

Question

Relax your shoulders

Answered: 1 week ago

Question

Keep your head straight on your shoulders

Answered: 1 week ago