Guest User

Untitled

a guest
Jun 25th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.41 KB | None | 0 0
  1. Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) : contrasts can be applied only to factors with 2 or more levels
  2.  
  3. kiva_country%>%
  4. mutate(model=map(data, ~lm(loan_usd~
  5. lender_count+
  6. borrower_genders,
  7. data=.)))
  8.  
  9. kiva_country <- structure(list(loan_usd = c(2.338196875, 0.059680115, 7.48223,
  10. 8.0273344125, 3.831743925, 215.01457025, 505.358195, 9.78200125,
  11. 1000, 4.47672105, 4.11658175, 3.9793076, 4.208754375, 6.54695125,
  12. 2.48706725, 4.208754375, 2.48706725, 6.9637883, 0.167062345,
  13. 1000, 3.273475625, 1.297111, 110.09751375, 8.885148125, 4.7680737,
  14. 4.208754375, 0.12114537875, 7.821505325, 0.358655535, 2.46994905,
  15. 3.704923575, 0.2094972, 1.9896538, 7.949869375, 4.208754375,
  16. 8.41750875, 0.09309369375, 2.735773975, 1100, 8.940735825, 0.0969744,
  17. 64.2817225, 4.67639375, 8.885148125, 824.805261, 7.949869375,
  18. 4.9741345, 5.6116725, 4.9741345, 1500, 105.68512775, 3.233187425,
  19. 0.6284916, 0.3351372975, 0.04344372375, 0.5379833025), sector = structure(c(1L,
  20. 8L, 5L, 4L, 7L, 7L, 5L, 3L, 4L, 9L, 10L, 1L, 1L, 9L, 11L, 9L,
  21. 5L, 5L, 4L, 2L, 1L, 4L, 5L, 9L, 5L, 5L, 9L, 4L, 9L, 11L, 2L,
  22. 1L, 1L, 5L, 9L, 9L, 1L, 1L, 10L, 7L, 1L, 1L, 5L, 5L, 5L, 5L,
  23. 11L, 9L, 5L, 7L, 11L, 1L, 1L, 1L, 8L, 1L), .Label = c("Agriculture",
  24. "Arts", "Clothing", "Education", "Food", "Health", "Housing",
  25. "Personal Use", "Retail", "Services", "Transportation"), class = "factor"),
  26. continent = structure(c(2L, 2L, 2L, 2L, 1L, 4L, 2L, 1L, 2L,
  27. 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 4L, 4L, 2L, 2L, 1L, 2L,
  28. 2L, 2L, 1L, 2L, 4L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 4L,
  29. 1L, 1L, 1L, 2L, 2L, 4L, 2L, 1L, 2L, 1L, 2L, 4L, 1L, 1L, 2L,
  30. 2L, 4L), .Label = c("AF", "AS", "OC", "SA"), class = "factor"),
  31. currency = c("PHP", "LAK", "PHP", "PKR", "MZN", "BOB", "ILS",
  32. "EGP", "USD", "KES", "PKR", "KES", "PHP", "PHP", "KES", "PHP",
  33. "KES", "KES", "PYG", "USD", "PHP", "AMD", "GHS", "PHP", "INR",
  34. "PHP", "TZS", "PKR", "COP", "PKR", "PKR", "NGN", "KES", "PHP",
  35. "PHP", "PHP", "KHR", "KES", "USD", "MZN", "UGX", "EGP", "PHP",
  36. "PHP", "PEN", "PHP", "KES", "PHP", "KES", "USD", "BOB", "KES",
  37. "NGN", "KHR", "KHR", "COP"), term_in_months = c(8, 8, 7,
  38. 14, 20, 27, 26, 14, 28, 8, 14, 14, 11, 8, 8, 8, 13, 20, 14,
  39. 14, 10, 26, 8, 8, 14, 8, 8, 21, 26, 14, 14, 21, 8, 5, 7,
  40. 8, 20, 13, 8, 17, 12, 14, 7, 7, 6, 13, 14, 8, 14, 27, 17,
  41. 11, 17, 14, 8, 26), lender_count = c(4L, 14L, 12L, 20L, 9L,
  42. 18L, 47L, 7L, 19L, 13L, 17L, 16L, 9L, 1L, 8L, 2L, 10L, 16L,
  43. 20L, 31L, 5L, 23L, 21L, 12L, 9L, 8L, 11L, 18L, 24L, 1L, 12L,
  44. 1L, 1L, 6L, 3L, 6L, 11L, 10L, 25L, 13L, 11L, 33L, 7L, 1L,
  45. 23L, 5L, 9L, 2L, 16L, 50L, 24L, 6L, 9L, 47L, 7L, 54L), borrower_genders = structure(c(4L,
  46. 1L, 4L, 4L, 4L, 5L, 4L, 4L, 4L, 5L, 4L, 4L, 4L, 4L, 5L, 4L,
  47. 4L, 4L, 5L, 4L, 4L, 5L, 4L, 4L, 4L, 5L, 4L, 4L, 5L, 4L, 4L,
  48. 5L, 4L, 4L, 4L, 4L, 2L, 4L, 5L, 4L, 5L, 5L, 4L, 4L, 1L, 4L,
  49. 5L, 4L, 4L, 5L, 4L, 1L, 5L, 2L, 1L, 4L), .Label = c("mixed_genders",
  50. "mult_females", "mult_males", "single_female", "single_male"
  51. ), class = "factor"), repayment_interval = structure(c(2L,
  52. 1L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 2L, 2L, 3L, 2L,
  53. 2L, 3L, 3L, 3L, 2L, 3L, 3L, 2L, 3L, 2L, 2L, 3L, 1L, 3L, 3L,
  54. 1L, 3L, 2L, 2L, 2L, 3L, 3L, 2L, 3L, 3L, 3L, 2L, 2L, 2L, 2L,
  55. 2L, 2L, 2L, 3L, 3L, 1L, 1L, 3L, 3L, 1L), .Label = c("bullet",
  56. "irregular", "monthly"), class = "factor"), total_time = structure(c(18.0661111111111,
  57. -6.60219907407407, 29.1945486111111, 29.1902546296296, 7.97133101851852,
  58. 30.5631365740741, 5.04092592592593, 1.01228009259259, 5.98796296296296,
  59. 1.1653125, 13.8973611111111, 13.9559837962963, 13.7842592592593,
  60. 14.7295833333333, 21.2200347222222, 11.8290277777778, 29.9896527777778,
  61. 11.0241087962963, 31.8087152777778, 2.49729166666667, 29.2423263888889,
  62. 6.22887731481481, -87.7889583333333, 13.9283680555556, 6.14564814814815,
  63. 30.7126388888889, 12.2280092592593, 25.1208564814815, 29.4325694444444,
  64. 21.1108796296296, 31.0914930555556, 30.2300462962963, 1.25987268518519,
  65. 10.8613078703704, 3.79240740740741, 0.917407407407407, 19.8486574074074,
  66. 21.0687847222222, 5.695, 14.0782291666667, 8.31921296296296,
  67. -2.75765046296296, 19.860162037037, 27.0577430555556, 30.387662037037,
  68. 2.95751157407407, 7.34555555555556, 7.81865740740741, 13.2225578703704,
  69. 29.897037037037, 2.38850694444444, -9.06731481481481, 28.2812615740741,
  70. 28.0569328703704, 8.96789351851852, 30.5188657407407), class = "difftime", units = "days"),
  71. giving_time = structure(c(5.0228587962963, 4.96018518518519,
  72. 6.74697916666667, 3.02984953703704, 11.6894675925926, NA,
  73. 6.43273148148148, 4.95670138888889, 0.677789351851852, 10.9498032407407,
  74. 28.4098263888889, 16.3449768518519, 3.79349537037037, 5.07239583333333,
  75. 11.9471412037037, 9.43681712962963, 11.59875, 2.85693287037037,
  76. 3.68746527777778, 8.92987268518518, 2.14872685185185, 37.4300810185185,
  77. 6.05579861111111, 6.35039351851852, 7.84884259259259, 2.58693287037037,
  78. 6.89646990740741, 3.7518287037037, NA, 8.25405092592593,
  79. 6.47818287037037, 8.38155092592593, 1.63341435185185, 5.70645833333333,
  80. 0.350752314814815, 10.3049074074074, 5.45354166666667, 28.2165509259259,
  81. 2.06465277777778, 19.6960069444444, 5.43849537037037, 10.4102430555556,
  82. 5.55040509259259, 10.5431134259259, 1.42528935185185, NA,
  83. NA, 8.27836805555556, 36.3757291666667, 31.4002893518519,
  84. 20.2938888888889, 15.9016319444444, 21.4788773148148, 12.0572916666667,
  85. 6.57180555555556, 34.8365046296296), class = "difftime", units = "days"),
  86. country_code = c("PH", "LA", "PH", "PK", "MZ", "BO", "IL",
  87. "EG", "PS", "KE", "PK", "KE", "PH", "PH", "KE", "PH", "KE",
  88. "KE", "PY", "BO", "PH", "AM", "GH", "PH", "IN", "PH", "TZ",
  89. "PK", "CO", "PK", "PK", "NG", "KE", "PH", "PH", "PH", "KH",
  90. "KE", "EC", "MZ", "UG", "EG", "PH", "PH", "PE", "PH", "KE",
  91. "PH", "KE", "TL", "BO", "KE", "NG", "KH", "KH", "CO"), posted_time = structure(c(1444034112,
  92. 1448386370, 1436528409, 1445340838, 1472797123, 1396128655,
  93. 1432627136, 1481703461, 1485157360, 1418299083, 1432614732,
  94. 1487141797, 1486954160, 1425951036, 1407932211, 1472007228,
  95. 1402555506, 1393317283, 1499653473, 1393444566, 1431002937,
  96. 1491913775, 1463054634, 1424845011, 1475144984, 1484874372,
  97. 1427891300, 1448358842, 1471454574, 1465465180, 1465809105,
  98. 1497357076, 1439471653, 1404445217, 1452567664, 1416895264,
  99. 1447730524, 1434443943, 1497915648, 1436345559, 1417189180,
  100. 1463662139, 1406605118, 1496305389, 1450891094, 1409983129,
  101. 1463584656, 1498012732, 1468326029, 1439958704, 1429287567,
  102. 1485152584, 1407419101, 1413447719, 1490249626, 1427228830
  103. ), class = c("POSIXct", "POSIXt"), tzone = "UTC"), funded_time = structure(c(1444468087,
  104. 1448814930, 1437111348, 1445602617, 1473807093, NA, 1433182924,
  105. 1482131720, 1485215921, 1419245146, 1435069341, 1488554003,
  106. 1487281918, 1426389291, 1408964444, 1472822569, 1403557638,
  107. 1393564122, 1499972070, 1394216107, 1431188587, 1495147734,
  108. 1463577855, 1425393685, 1475823124, 1485097883, 1428487155,
  109. 1448683000, NA, 1466178330, 1466368820, 1498081242, 1439612780,
  110. 1404938255, 1452597969, 1417785608, 1448201710, 1436881853,
  111. 1498094034, 1438047294, 1417659066, 1464561584, 1407084673,
  112. 1497216314, 1451014239, NA, NA, 1498727983, 1471468892, 1442671689,
  113. 1431040959, 1486526485, 1409274876, 1414489469, 1490817430,
  114. 1430238704), class = c("POSIXct", "POSIXt"), tzone = "UTC"),
  115. disbursed_time = structure(c(1442473200, 1448956800, 1434006000,
  116. 1442818800, 1472108400, 1393488000, 1432191600, 1481616000,
  117. 1484640000, 1418198400, 1431414000, 1485936000, 1485763200,
  118. 1424678400, 1406098800, 1470985200, 1399964400, 1392364800,
  119. 1496905200, 1393228800, 1428476400, 1491375600, 1470639600,
  120. 1423641600, 1474614000, 1482220800, 1426834800, 1446188400,
  121. 1468911600, 1463641200, 1463122800, 1494745200, 1439362800,
  122. 1403506800, 1452240000, 1416816000, 1446015600, 1432623600,
  123. 1497423600, 1435129200, 1416470400, 1463900400, 1404889200,
  124. 1493967600, 1448265600, 1409727600, 1462950000, 1497337200,
  125. 1467183600, 1437375600, 1429081200, 1485936000, 1404975600,
  126. 1411023600, 1489474800, 1424592000), class = c("POSIXct",
  127. "POSIXt"), tzone = "UTC")), row.names = c(NA, -56L), class = c("tbl_df",
  128. "tbl", "data.frame"))
Add Comment
Please, Sign In to add comment