Question
NEED TO DO IN PROGRAM R

Wage EDUC EXPER AGE Male 40 39 38 53 59 36 45 37 37 43 32 40 49 43 31 45 31 37.85 21.72 14.34 21.26 24.65 71 25.65 815.45 9 2
1 0 1010100101010000110 0288072 703131755760 534335345536 5 3 934605F 644 566 4669574644659 1952 6340 6453991 .9 .3 .4 4838 1
10010110100 0548 6_3-322444456 32762 05041027251 44956794148 91 56754 60 6834 736 2 3634 2122 2 /9012 345678 123 4-4-4 567 4-
64 Click Q☆ Read the Excel file into R > mydata <read dsxf file choose0) a. A logistic regression must be used when the Y var
>fitlogit<-glm(Y-X1+ X2+X3+X4, data mydata, family-binomial(link logih)) summary(fitlogit) Logit(Male)-86851.233 Wage41EDUC -
Wage EDUC EXPER AGE Male 40 39 38 53 59 36 45 37 37 43 32 40 49 43 31 45 31 37.85 21.72 14.34 21.26 24.65 71 25.65 815.45 9 20.39 10 29.13 11 27.33 12 18.02 1320.39 15 12 1 0 12 14 18 1424.18 1517.29 16 15.61 1 10 17 35.07 18 1920.39 20 21 40.33 14 16.61 16.33 30 28 Ch17 009 Data File ype here to search
1 0 1010100101010000110 0288072 703131755760 534335345536 5 3 934605F 644 566 4669574644659 1952 6340 6453991 .9 .3 .4 4838 113 988 7 696 211 8 2 2111 2 0123 3,333 0-78
10010110100 0548 6_3-322444456 32762 05041027251 44956794148 91 56754 60 6834 736 2 3634 2122 2 /9012 345678 123 4-4-4 567 4-4.4 4:55-5-5
64 Click Q☆ Read the Excel file into R > mydata fitlogit summary(frogeの which of the two variables is significant (useful n te model) at a 10% significance level? Cick to select) O Type here to search の
>fitlogit predict glm(fitiogit, type="response.. data frame(X14, X2 X3e# X4")) c. What is the p-valkue of the predictor variable that is most useful in the logistic regression mode? (Round your answer to 4 decimal places) d. Run another logistic regression model, this time using only Wage and EDUC to predict the probability that an employee is male Х1 + X2 data:mydata, family-binomíal(link#7ogir) summarythtogicz) which of the two variables is significant (useful in the model) at a 10% significance | (Cick to select) e. Use the logistic regresion model from part (d) to predicdt the probability that an employee s maleifthe employee eams $30 per hour and has 8 years of tigher education > predict glmift ogt2 type*Tesponse. dato frame(X1zB X2a#1) alllch:4.3 pata,F Ch17.009 pata,F O Type here to search
0 0
Add a comment Improve this question Transcribed image text
Answer #1

a) Run the following code:

fitlogit <- glm(Male~Wage+EDUC+EXPER+AGE, data=mydata, family=binomial(link="logit"))
summary(fitlogit)

Results are:

Coefficients:
Estimate Std. Error z value
(Intercept) -5.18674 2.09966 -2.470
Wage 0.11319 0.07883 1.436
EDUC 0.32020 0.17132 1.869
EXPER 0.02064 0.06772 0.305
AGE 0.01471 0.03478 0.423
Pr(>|z|)
(Intercept) 0.0135 *
Wage 0.1510
EDUC 0.0616 .
EXPER 0.7605
AGE 0.6724

Hence, Logit(Male) = -5.187 + 0.113(Wage) + 0.320(EDUC) + 0.020(EXPER) + 0.015(AGE)

b) Run the following code:

predict.glm(fitlogit,type="response",data.frame(Wage=30, EDUC = 8, EXPER = 20, AGE = 50))

Result: 0.872

c) Most important predictor from the above table (which has the lowest p-value) = 0.0616

d) Run the following code:

fitlogit2 <- glm(Male~Wage+EDUC, data=mydata, family=binomial(link="logit"))
summary(fitlogit2)

Results:

Coefficients:
Estimate Std. Error
(Intercept) -4.57524 1.70025
Wage 0.13429 0.07161
EDUC 0.28704 0.15712
z value Pr(>|z|)   
(Intercept) -2.691 0.00713 **
Wage 1.875 0.06073 .
EDUC 1.827 0.06772 .

Both the variables are significant at 10% significance level as p-value of both < 0.1

e) Run the following code:

predict.glm(fitlogit2,type="response",data.frame(Wage=30,EDUC=8))

Answer: 0.852

Add a comment
Know the answer?
Add Answer to:
Wage EDUC EXPER AGE Male 40 39 38 53 59 36 45 37 37 43 32 40 49 43 31 45 31 37.85 21.72 14.34 21....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT