Applied Quantitative Methods IIHomework Assignment # 2Use a software of your choice to answer the questions. Be sure to upload your final codeand your typed answers on Carmen.1. Estimation of...

1 answer below »
Applied Quantitative Methods. / Econometrics
Assignment to be done in R Studio with knitting the results.



Applied Quantitative Methods II Homework Assignment # 2 Use a software of your choice to answer the questions. Be sure to upload your final code and your typed answers on Carmen. 1. Estimation of the probability of mortgage default. The probability of default is an important input in the calculation of expected losses in credit risk modeling: Expected Loss= (Probability of Default)*(Loss Given Default)*(Exposure at Default) The data for this assignment comes from the Consumer Finance Monthly dataset collected by OSU’s center for Human Resources Research. The dataset was collected from a nation- ally representative sample in five waves from February 2005 to December 2007. For the purpose of this assignment we focus on the performance of mortgage loans. Consider the following mortgage default model: defaulti = { 1 if Xiβ + �i > 0 0 otherwise (1) where X is the matrix of variables listed in the table below (excluding default) plus the intercept and β is a conformable parameter vector. Estimate the mortgage default model by the linear probability model (LPM), Probit, and Logit and present the coefficients in one table along with their standard errors. Present the marginal effects (or average partial effects) and their standard errors in a different table. Discuss/interpret the results. 2. Checking parameter stability. A common practice in the financial industry is to check the robustness/stability of pa- rameter estimates as new data is collected. This is generally done by re-estimating a model by dropping older data and adding new data and examining the robustness of the results to the change in the data. Redo question 1 by considering four waves at a time instead of the full dataset. Specifically, estimate the default model (1) by Logit using data from waves 1-4 and waves 2-5, respec- tively (wave indicator is available in the dataset). Report the marginal effects (or average partial effects) and their standard errors in one table. 1 marshall.624 Cross-Out 3.) ROC/AUC and model backtesting. Randomly allocate 70% of the data to a training dataset and the remaining to a validation (backtest) dataset. Use the training dataset to estimate the predicted probabilities of de- fault by Logit only. Report the Logit parameter estimates, their standard errors, the ROC curve and corresponding AUC. Use the estimated parameters from the training dataset to score the validation data; report the ROC curve and ACU for the validation dataset. 4.) Compute and report the result of the test that the model is uninformative, i.e pre- dictions from the Logit model are as good as random. 5.) Discuss/interpret the overall results (questions 1-5). Table 1: List of dependent and explanatory variables default =1 if household is delinquent for more than 90 days or filed for bankruptcy (dependent variable) num misspay number of missed payment on all debt pay to inc back-end monthly payments (all debt sources) as a percentage of household income ltv mortgage loan as a percentage of assessed value of the home unem rate state unemployment rate children number of children (younger than 18) in the family age age of household head age2 square of age of household head 2 cfm_default_data childrenwaveageunem_ratenum_misspaydefaultpay_to_incltv 01436.60121.739130485.7142857 21423.90020.335051665.3333333 01405.50021.704180155.7692308 11465.50027.692307721.4285714 01305.50014.364705979.1666667 01524.80012.616822450 01444.83072.530 01534.80025.39651071.5 01574.8001216.6666667 01524.80017.153628729.3333333 01694.80024.256336732.4324324 01613.91071.133333392.3076923 01493.90021.544401583.3333333 01553.90116.872998984.2105263 21775.40134.748409535.2 01615.4004.600997521.9230769 01505.41117.980703657.6923077 21375.40026.927072585 01455.40036.547619182.010582 01465.4117.92947582.3529412 014050014.241245166.6666667 014051120.3239465100 01405009.164383657.1428571 015250019.816723947.2222222 3135500150 01485.8009.625348746.6666667 01475.80023.881347463.6363636 01635.80060.843699323.0769231 01614.21028.331226358 21334.21020.482705256.6666667 11354.20017.43286587.5 11314.20019.480195126.4 31285.40025.961538563.3333333 11445.43021.827040242 01487.80048.659.0909091 11585.21069.428571476 31445.20162.412514.2857143 01473.90025.866666747.5 21506.9002141 21376.90046.458333367.6923077 01516.90094.90563986 31333.90013.893362474.8201439 11545.30034.043538784.8648649 01435.5004.918269260.7142857 11475.40016.147058838.8888889 11353.9001466.6666667 01553.90022.054054150 11293.90018.588.5714286 01305.40028.373819290.1554404 01645.40026.694915344.5714286 01445.40013.06134638.5 01544.8009.756440924 01534.8106.244392666 21376.91015.254237330.6 01556000.45571935.9259259 013760026.666666775.9259259 01565.4008.763888930 11325.43034.726027485.7142857 01424.10020.429829150 01574.1008.622754538 21424.10016.143790933.3333333 21414005.050921358.974359 01335.1004.857.1428571 21485.10015.782788480 01525.10019.011013267.4193548 01335.1001278.0487805 01485.10040.723014350 01725.10010.510 213550011.333333392.9411765 015356031.547911660 013753055.864626839.2 01633.90018.857142993.75 21475.40016.68900832.7272727 11456.9010.936037452.2222222 01525.40016.346153955.5555556 21405.40120.570291848.1818182 313750026.904761927.2 01415.1205.607476634 21455.11120.989143690 01725.40047.825701983.8709677 01625.40073.920073976.9230769 21425.40093.62549.3333333 01496.70153.3049041100 21564.30048.510048584.2105263 21494.20021.659883236 01515.90019.764705948.1818182 31385.90025.522252560.8695652 01555.90023.496862563.2 01383.9008.333333366.6666667 01303.90030.821917814 01456.70024.244186190.5263158 21376.7009.602473585.7142857 01226.74062.19512266.6666667 11383.90012.213017871.1111111 01553.90033.269230866.6666667 31393.9007.62584.9090909 01353.90117.167436743 11455.50028.353537661.1428571 01445.50017.721142821.6666667 11495.50019.591836750 01575.50023.6301373.7037037 51475.50020.357142965.8333333 01315.50026.822157455.5555556 11515.50017.090497732 01525.10011.944615444.4444444 01483.9009.516709535 01583.910047.441860572 21473.9009.770114920 01593.90013.333333323 01553.9014.014471854.1666667 01573.90127.161602219.4285714 31384.50018.481751871.4285714 01553.9006.592105340 31343.90036.568228129.2083333 01563.90023.372307758.3333333 11385.40010.151506266.6666667 01575.40010.047846910 01505.42119.12240194 01595.40034.478260958 01525.40143.844178191.4285714 21384.10128.332337156.5714286 01314.1008.842105366.6666667 21364.10018.256410366.6666667 31374.10014.450 01684.80120.692307763.3333333 01665.40015.769230841.6666667 21335.40014.017605176.4705882 01615.40017.356898911.1111111 21345.90139.525691778.3333333 21435.6003.275862170 11495.50025.418994463.3333333 01585.50017.27332245.3163636 11345.5001.749562650 21425.5001528.5714286 21414.23112.307692370 31344.20024.357476678.6666667 01324.20062.572861677.3913044 11495.90029.644808753.8461539 21295.10037.133333350 11445.11111.905808577.7777778 31274.60023.641304456.3636364 21544.60092.592592654.1666667 01254.60012.422680496.4285714 01525.10022.648 11455.10035.333333385.7142857 313960012.43891689.2307692 014360016.666666762.9310345 01606.20118.333333341.6666667 01876.2100.933333315 01526.2002451.25 01526.2007.272727328.5714286 01526.20026.493506556.3380282 01436.20023.553156162.5 01526.20026.758241814.5945946 01466.21034.50657970 01496.20048.62579.3548387 01586.20092.857142925 11435.20077.914285766.6666667 21465.20014.015151536 01534.20018.372252839.2857143 01374.9004.022824560 31394.90123.849834475 01524.90018.595918434.2857143 21354.90024.352409665.8823529 21475.50015.414729669.2307692 31275.50023.870094739.2857143 11405.50013.055141663.7837838 11675.40020.833333331.25 21355.40023.43787655 01595.40111.776251225 01655.4007.9687522.8571429 01575.40031.232146354.5454546 01465.40044.779411857.1428571 31365.91043.03088877.1428571 31445.9007.628734928.8461539 01776.90022.34567996.7741936 11396.90035.590706985.7142857 11706.90027.772727362 01525019.890109926.6666667 11425.4007.373271956.6666667 11213.50016.758775267.1641791 21343.50021.634615423.3333333 21413.50021.03896166.6666667 01516.20011.332417612.5 21386.22118.87966810.6 11556.28021.271771628.5714286 11476.20127.620621361.6 41396.20024.677.5 21326.20072.967422478.245614 11475.4005.891103833.3333333 21325.4104.982954672.6495727 31475.40060.2134.75 01605.40012.68617024.6666667 01653.90085.961538520 01535.41034.753709225 21555.40012.272727331.4606742 114250012.539308250 015252055.099715148 012850011.640540172.2222222 31355.40030.688073468 21365.40030.964559750 11335.40013.263157977.2727273 21505.40030.857142943.75 015750112.137248269.2307692 21406.90027.7852.5 21336.91153.391304451.8181818 41346.90039.903846288 21346.90044.12576.9784173 21463.60014.581132125 01553.60017.538461525 01543.6004.333333342.5 91373.60041.329284878.5714286 41413.62128.626320985.7142857 214160113.186813225 016360038.461538530 015860046.052173916.6666667 21335008.407547284.2105263 31494.8009.642857139.2857143 01495005.17414635 11465007.142857125 214751041.479.5454546 11525.9001.979104541.9811321 01415.90118.393284796.6887417 31415.91021.230769272.2222222 01525.91072.904238671.2962963 01625.6000.650 01235.60024.119931390.6666667 01495.60012.761432145 215.6009.921328740 21496.90016.541164714.2857143 21486.9003.319612652 01445.8008.863636411.3333333 11415.80023.752969128.5714286 11415.80020.749279540 01525.80041.266968352 01455.80122.576551778.9473684 01575.40015.662337741.6666667 01555.40020.01358735.2941177 01495.40057.333333350 31335.40136.912751750 01515.13030.186335414.8307692 01585.1005.78365818.2857143 11474.60016.060682135 11425.40017.625231922.6666667 01555.8001.43478269.6 11545.80011.416666721.3333333 015750020.60085845.3333333 214350047.540 01295.4008.392556.6666667 01684.3004.12550 01494.3008.609216456 01495.40063.461538525 31454.20010.169491540 01484.20016.472727341.6666667 31444.20123.296551779.0697674 01424.2205534.375 31394.20015.727081134 31275.40032.616672684.2857143 01547.80017.226666745.8333333 11355.20013.544018133.3333333 21335.20016.558441677.7777778 01504.20133.9620 01584.2009.25280930 01524.21128.187919531.875 21313.50028.642335866.6666667 01603.52027.403846266.6666667 21413.5004.536585410 01613.50022.18487456.25 21435.3005.870410459.8214286 11285.30043.571428681.4814815 11275.21026.444444475 01625.20028.449 21435.40027.625570850 01465.4009.49741328.5333333 01545.83130.2476 01314.30012.914088172.3076923 01584.30022.689540740 31555.40088.111888188.4615385 11485.40073.818181828.3333333 01435.4004.0548.8888889 01325.4003.500455858 01654.80026.40845077.5 31344.80161.226666752.2222222 11374.80023.040351141.6666667 01454.80019.101521148 514350027.283281752.7777778 015451010.289716934.2857143 015450041.196581213.5 012550094.022346463.8888889 115053038.890909178.2857143 115850020.920 11435.1402.259257.4712644 01565.1006.976744253.3333333 11325.1007.773279430 114052015.57142863 11363.90035.720489530 01733.9001.923076925.8 01513.90048.720800951 01443.90026.621359262.1428571 01754.50048.99792140 21474.50028.554216925.7142857 01476.90026.51057481.4814815 01336.90047.935483958.25 11296.90022.945368243.3333333 01495.91010.465116368 01433.50015.183673542.6666667 21403.50018.268398350 01573.50030.666666753.3333333 21303.50017.357142936.6666667 01373.50024.390243991.8918919 21413.50026.011560741.5384615 41335.42019.480519557.1428571 11485.4009.504224176.9230769 21355.40018.114011737.5 01535.4006.758620732 01655.40017.333333339.8181818 21514.20028.596153977.7777778 01614.20045.534743240 31454.22012.164348150 11374.20014.928738268 31425.40115.3990615.7142857 -115.2006.1820 01435.20122.040727342.8571429 01735.22086.160473956 31505.87060.151387761.5384615 01465.80011.871886120 01564.22052.72618334.4 21544.90011.774193644.4444444 11454.21034.126984187.5 31433.50022.435897450 01576.70033.419165745.6 11376.70023.432115862.8571429 21353.50020.098191250 01243.50021.822916773.9130435 01463.520121.89830236 01403.50043.879.7297297 11515.40013.96303968.5714286 11512.70025.714285720.8333333 01572.70018.510638328.5714286 01722.70046.36363640.6 01575.4004.724409550 31355.40022.408163364.7058824 01535.40027.663551468.5714286 31395.40023.333333337.1428571 01503.90127.190243983.3333333 11383.90031.2562.5 21363.9008.049230824.2857143 016850028.785714366.6666667 015750023.163517945.7142857 01585209.453781521.25 213650042.251357229.1666667 01495.80130.816501154.6875 21335.80038.265306160 11355.8007.841698826.3157895 01445.40014.85383236 01565.40016.538461529.5238095 01425.40032.213978992.0634921 11375.40120.961538585.3333333 31275.40016.730769272 01515.42018.163987133.3333333 31475.3007.510309722.2727273 01655.3001511.7647059 01355.30027.336244546.6666667 01615.30018.410526364 21515.4005.376712340 21466.70015.030060166.6666667 21295.80012.497162331.5789474 01785.80026.666666725.3846154 01505.8011.153846266.6666667 01685.80022.520 01593.90081.63265310.5652174 21453.90027.054545552 21384.50014.633663427.2727273 11454.50022.336108246 01315.40023.974895470 21455.40024.923076994.1176471 11464.90014.868233664 213.90130.769230883.3333333 01655.6002762.5 21365.10017.081850581.8181818 01333.90019.388888994.1176471 01453.90030.8862.4 21246.92015.572916748 21366.90011.450839740 01674.50013.00690254.3333333 11454.5005.825242720 01354.50013.742271232 31414.50073.590511334.4444444 11515.4002.03883542.1052632 01605.40015.481651416.2162162 01505.3008.46347612.3809524 01225.30022.2916667100 01495.1609.3685.7142857 113550015.726767363.3333333 012650028.495575222.2222222 213350012.550458728.8888889 31315.40013.373199244.4444444 11425.40023.260073368.3333333 01555.40018.792452847.2727273 01535.40013.383529416.6666667 01555.40013.22033932.6666667 21335.40020.6555 21355.4008.100358436.9230769 31325.40127.19512274 21485.40067.692307740 01535.40023.913043540 11325.4009.788519643.6363636 11564.500107 01474.50021.547502512 21434.5001954.1666667 01365.3008.181818272.7272727 01435.3007.542857118 01565.30019.558457710.4 21345.30019.421052662.2222222 11505.30013.814814888.5714286 01495.30010.377358530 01605.30038.831492746.6666667 21435.30012.2546.2222222 01574.8003.573130122.2222222 01454.82029.95266166.6666667 21384.8003.40798448 11595.41048.392306662.3255814 21375.40021.118760838.7096774 01245.60032.201183480.9090909 01645.40032.578.5714286 01335.90050.322580793.3333333 11295.40010.789743669.2307692 01753.90071.777777850 01565.40024.136577710 11365.40040.905441651.4285714 01654.2002.571428623.5294118 01584.2004.382616430 01613.90026.590693335.8974359 21355.10024.462.5 01505.40011.320754771.4285714 11285.40025.289256257.5 01684.50019.075144528.1481482 01634.5007040 01334.92011.797752842.7272727 01464.90017.534148150 01695.40020.876227936.4 01516.90067.199478174.1935484 11386.90016.783.3333333 31445.90021.76308542.4 01615.90025.95505628 11385.90010.621387380 01263.60013.397414163.1578947 01284.30016.074074180 21376.70013.664596343.3333333 11605.45047.827667743.3333333 01543.80021.36363642 01473.50076.923076980 31275.10020.303030399.4285714 01623.9008.1676923100 31344.20019.072398250 01465.20027.663461530.7692308 01495.20011.749049442.5 11336.70016.954923127.2727273 01554.30010.440835335 21426.90029.465 413450012.589285743.75 01505.40020.433436536.3333333 01475.40033.461538520 31465.40035.990415338.8888889 01255.80022.857142980 21466.9000.426995640 01615.40114.444505639.3333333 21494.21023.036450721.6666667 01435.40013.113627219.5555556 01445.80016.621621619.2307692 02324.9014.702266645.4545455 32444.90122.0719603100 12254.30017.396593776.1904762 02584.9004016.2222222 22444.60014.751381247.5 024.9003.54545466.5 02304.70038.785625888.2352941 12384.60037.6850 324532014.358736156.6666667 02613.80013.382352936.6666667 12514.90035.572118213.1578947 12544.6002.95302018 124.90015.7549.5238095 22244.96020.833333380 22486.9006.533101171.4285714 22484.70018.923076968.9655172 025330016.786570775 12534.90052.267241484 02584.90074.074074162.5 32454.6008.928571440 02655.4003140 02594.90030.312907454.0540541 026030020.94594625.7142857 02583.80168.644662976.8 52364.91025.410526382.3529412 02546.50024.10958945 22504.9002.857142936.6666667 125330133.740053175.7142857 02564.9002480 02533.50011.320754752.173913 023930113.597402646.3320463 02633005541.6666667 12404.60011.64585720 22344.60117.196745639.3333333 22294.30058.791208895 123730019.047619161.5384615 02513.40019.215 02544.90056.756756828 02494.10140.676430634.4 024.70016.2468.1818182 32304.80031.79163970.2857143 22474.90022.857142928.6153846 12523.8006.804326522.2222222 02604.90033.767840248.3333333 12554.91014.184897718.8 02524.90022.24719129 02633.4006016.5714286 02624.60020.885714340 02364.60030.578158575 22384.70015.7538.8888889 22374.90021.573134342.3076923 12494.90028.353344850 02664.80018.03278694 22504.96050.242214530.6666667 02514.90015.350 12365.30018.399710455.6818182 12384.40014.302807259.375 02584.60016.269515259.4871795 32335.40035.934065984.0425532 12514.60019.885714333.3333333 02504.90028.90173418.8235294 12474.12129.97675 02574.90110015 22504.9001.725813278.7878788 42395.40025.0961539100 124003561.0062893 02504.76125.57885881.6666667 12486.41023.084745885.3333333 22414.61012.002330632.4324324 12464.60010.038123244.6153846 02424.40047.272727350 22406.90019.033232636 02505.40016.438356243.9393939 12274.70020.37680 12574.70017.067494224 32414.7006.836158239.1666667 02555.80029.176470674 223830014.747663657.8125
Answered 2 days AfterFeb 02, 2023

Answer To: Applied Quantitative Methods IIHomework Assignment # 2Use a software of your choice to answer...

Mohd answered on Feb 05 2023
39 Votes
R Notebook
R Notebook
Importing required packages and data
library(magrittr)
library(dplyr)
library(readxl)
library(margins)
library(caret)
cfmdefaultdata <- read_excel("cfmdefaultdata.xlsx")
#View(cfmdefaultdata)
Descriptive statistics
skimr::skim(cfmdefaultdata)
Data summary
    Name
    cfmdefaultdata
    Number of rows
    2852
    Number of columns
    8
    _______
________________
    
    Column type frequency:
    
    numeric
    8
    ________________________
    
    Group variables
    None
Variable type: numeric
    skim_variable
    n_missing
    complete_rate
    mean
    sd
    p0
    p25
    p50
    p75
    p100
    hist
    children
    0
    1
    0.94
    1.23
    -1.00
    0.00
    0.00
    2.00
    12.0
    ▇▃▁▁▁
    wave
    0
    1
    2.87
    1.15
    1.00
    2.00
    3.00
    4.00
    5.0
    ▅▅▇▇▂
    age
    14
    1
    48.07
    12.42
    -4.00
    39.00
    48.00
    56.00
    91.0
    ▁▂▇▅▁
    unem_rate
    0
    1
    4.71
    0.92
    2.50
    4.20
    4.70
    5.20
    7.8
    ▂▇▇▁▁
    num_misspay
    0
    1
    0.29
    1.07
    0.00
    0.00
    0.00
    0.00
    20.0
    ▇▁▁▁▁
    default
    0
    1
    0.11
    0.31
    0.00
    0.00
    0.00
    0.00
    1.0
    ▇▁▁▁▁
    pay_to_inc
    0
    1
    26.00
    18.24
    0.05
    13.33
    21.46
    33.17
    100.0
    ▇▆▂▁▁
    ltv
    0
    1
    48.15
    25.37
    0.04
    28.00
    48.73
    67.45
    100.0
    ▆▇▇▇▃
## creating new datframe
cfmdefaultdata_df<-na.omit(cfmdefaultdata)
# removing wave column from dataframe
cfmdefaultdata_df$wave=NULL
primary logistic model
logit<-glm(default~.,data = cfmdefaultdata_df,family="binomial")
## using stepAIC
logit_aic<-stepAIC(logit)
## Start: AIC=1831.51
## default ~ children + age + unem_rate + num_misspay + pay_to_inc +
## ltv
##
## Df Deviance AIC
## - unem_rate 1 1817.9 1829.9
## - pay_to_inc 1 1818.1 1830.1
## 1817.5 1831.5
## - children 1 1825.0 1837.0
## - num_misspay 1 1832.4 1844.4
## - age 1 1837.4 1849.4
## - ltv 1 1887.3 1899.3
##
## Step: AIC=1829.92
## default ~ children + age + num_misspay + pay_to_inc + ltv
##
## Df Deviance AIC
## - pay_to_inc 1 1818.5 1828.5
## 1817.9 1829.9
## - children 1 1825.3 1835.3
## - num_misspay 1 1832.7 1842.7
## - age 1 1837.9 1847.9
## - ltv 1 1888.4 1898.4
##
## Step: AIC=1828.49
## default ~ children + age + num_misspay + ltv
##
## Df Deviance AIC
## 1818.5 1828.5
## - children 1 1826.1 1834.1
## - num_misspay 1 1833.8 1841.8
## - age 1 1839.8 1847.8
## - ltv 1 1892.5 1900.5
Probit logistic model
## Probit logistic model
probit <- glm(default ~ children + age + num_misspay + ltv, family = binomial(link = "probit"), data = cfmdefaultdata_df)
## Model output summary
stargazer::stargazer(logit_aic,probit,type = "text")
##
## ==============================================
## Dependent variable:
## ----------------------------
## default
## logistic probit
## (1) (2)
## ----------------------------------------------
## children 0.144*** 0.079***
## (0.051) (0.027)
##
## age 0.027*** 0.014***
## (0.006) (0.003)
##
## num_misspay 0.176*** 0.096***
## (0.044) (0.025)
##
## ltv 0.023*** 0.012***
## ...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here