Business Experiments with R. B. D. McCullough

Чтение книги онлайн.

Читать онлайн книгу Business Experiments with R - B. D. McCullough страница 12

Business Experiments with R - B. D. McCullough

Скачать книгу

For each of the following, indicate whether the data are observational or experimental, and defend your answer.A broadcaster moves a popular television show from Tuesday to Thursday, and its viewership increases.A psychologist wants to know how often students take a break from studying. To do this, he installs cameras in the library's reading room for one day. He notes that students take more breaks in the evening.A sports manufacturer wonders if his quick‐dry exercise shirts dry more quickly than regular shirts. He finds some basketball players playing a game in the gym. He gives one team quick‐dry shirts, and the other team gets regular 100% cotton shirts.A child psychologist asks several parents whether their children play violent video games. He also asks how many times a week their children display violent behavior. He finds that children who play violent video games display more violent behavior.

      3 1.1.3 Give two situations where experiments can't be conducted.

      In this problem we are confronted with the ultimate questions confronting all credit issuers: whether to grant credit to each potential customer and, if so, how much? Generally, we don't want to give credit to people who are likely to default, and if we do give credit, we don't want to give more than the person can repay.

Female Male
0 14 349 (79%) 9 015 (76%)
1 3 763 (21%) 2 873 (24%)
Total 18 112 11 888
Married Single Other
0 10 453 (77%) 12 623 (79%) 288 (76%)
1 3 206 (23%) 3 341 (21%) 89 (24%)
Total 13 659 15 964 377

      Try it!

      We encourage you to replicate the analysis in this chapter using the data in the file credit.csv . Computing crosstabs can be done in a spreadsheet using pivot tables. Most statistical tools also have a cross‐tabulation function.

      df <- read.csv("credit.csv",header=TRUE) # Table 1.1 table1 <- table(df$default,df$sex) # to get the counts table1 # to print out the table prop.table(table1,2) # to get column proportions prop.table(table1,1) # to get row proportions

Box plots depicting that persons who do not default have higher credit limits than persons who default, while age appears to have no association with default status.

      If it is really the case that persons with higher credit limits are less likely to default, can we decrease the default rate simply by giving everybody a higher credit limit?

      Software Details

      To reproduce Figure 1.2, load the data file credit.csv

      boxplot(limit∼default, xlab="default", ylab="credit limit", data=df)

      We have thus far looked at how the four variables are associated with default, individually. How might we examine the effects of all the variables at one time in order to answer the two fundamental questions?

equation

      Marital status (married, single, or divorced/widowed) will be represented by two dummy variables, images and images:

equation

      For a married person, images and images, for a person who is divorced/widowed images and images,

Скачать книгу