Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Only 10, 000 Pink Splendor Barbies were ever produced. Suppose we want to estima

ID: 3291155 • Letter: O

Question

Only 10, 000 Pink Splendor Barbies were ever produced. Suppose we want to estimate the current asking price of a Pink Splendor Barbie. The sample data below are the "Buy it Now" prices for Pink Splendor Barbies listed on eBay. There will be 18 prices in the sample. The 18^th price is whatever the last three digits of your student ID number are. For example, if your student ID number is 1940G3G8, the 18^th price would be 368. Using R, find a 95% confidence interval for the mean asking price of a Pink Splendor Barbie. Copy a screenshot of your R code and output into your assignment. The following should be present in your R code: 1. manual data entry and storage OR data entry ad storage via the read.csv function 2. use of the mean function to compute the sample mean 3. creation of a vector where 10, 000 numeric values can be stored 4. use of a for loop to generate 10, 000 bootstrap sample means 5. use of the quantile function to find the appropriate confidence interval endpoints Fisher State College is thinking of going from the quarter system to the semester system. A random sample of 200 students shows that k are in favor of the change, where k is the first three digits in your student ID number. For example, it your student ID number is 19406368, k would be 194. Using R, find a 90% confidence interval for the proportion of all students at Fisher State College who favor the change. The following should be present in your R code: 1. use of the rep function to store the sample proportion 2. creation of a vector where 10, 000 numeric values can be stored 3. use of a for loop to generate 10, 000 bootstrap sample proportions 4. use of the quantile function to find the appropriate confidence interval endpoints

Explanation / Answer

FIRST QUESTION IS ANSWERED ONLY

CODE:

#assuming the last 3 digits of your roll number is 575
data=c(300,265,299,400,375,300,700,475,850,420,695,400,250,734,500,400,720,575)
m=mean(data) #sample mean
vector=numeric(10000) #creation of vector where 10000 numeric values can be stored
for( i in 1:10000)
{
vector[i]=mean(sample(data,18,replace=TRUE))
}
vector
quantile(vector,.05)
quantile(vector,.95)

OUTPUT:

> data=c(300,265,299,400,375,300,700,475,850,420,695,400,250,734,500,400,720,575)
> m=mean(data) #sample mean
> vector=numeric(10000) #creation of vector where 10000 numeric values can be stored
> for( i in 1:10000)
+ {
+ vector[i]=mean(sample(data,18,replace=TRUE))
+ }
> vector
[1] 458.5000 451.6111 426.5000
[4] 446.8889 559.2222 447.8333
[7] 424.1111 523.2778 513.6667
[10] 489.6667 440.3333 406.7778
[13] 443.2222 471.8333 490.0556
[16] 450.7778 473.2778 484.8889
[19] 390.2222 510.7222 466.5556
[22] 412.3889 401.3889 489.4444
[25] 460.5000 478.5556 478.8333
[28] 465.2778 523.8889 529.2222
[31] 451.8889 463.7222 455.9444
[34] 463.4444 484.3333 448.5556
[37] 463.8333 495.1111 492.3333
[40] 449.0556 481.8333 462.3333
[43] 464.3333 502.4444 468.8889
[46] 462.7222 531.8889 507.0556
[49] 465.3889 474.3889 475.6667
[52] 515.2778 396.2778 468.0556
[55] 417.3333 449.7222 523.2222
[58] 468.1667 498.1667 440.3889
[61] 484.2222 416.6667 444.6667
[64] 455.1667 498.0556 475.8333
[67] 469.5556 414.8333 536.9444
[70] 436.8333 460.8333 475.7222
[73] 442.7222 467.5556 458.6111
[76] 387.1111 405.7222 415.4444
[79] 475.7778 549.7222 557.3333
[82] 476.8889 517.1111 497.4444
[85] 432.2222 481.1111 435.1667
[88] 428.2778 477.8889 447.1111
[91] 510.1667 447.0556 422.1111
[94] 549.8889 431.9444 465.5556
[97] 500.1667 421.3333 498.8333
[100] 541.3333 436.0000 466.2222
[103] 490.8333 537.2222 569.0556
[106] 482.7222 474.3333 465.7778
[109] 515.8889 469.6667 524.3889
[112] 490.3889 491.5556 514.6111
[115] 414.8889 452.4444 435.3889
[118] 398.8889 537.0000 529.3889
[121] 498.2778 443.5556 545.0000
[124] 458.5556 482.8333 459.3889
[127] 480.1111 417.3889 437.0000
[130] 414.6667 512.3889 475.6667
[133] 505.0000 459.1111 515.4444
[136] 449.8889 392.7222 414.5556
[139] 404.6111 526.0000 464.7222
[142] 438.0000 486.6111 525.1667
[145] 413.0000 433.5000 514.6111
[148] 558.2778 534.3333 516.8889
[151] 546.6111 474.3889 400.2778
[154] 414.6667 501.0000 475.0556
[157] 495.1667 434.4444 535.2222
[160] 555.4444 507.4444 504.9444
[163] 416.7778 463.4444 496.3889
[166] 463.0000 497.3333 438.0000
[169] 540.2222 456.5556 453.5556
[172] 471.5556 437.6111 532.4444
[175] 442.2222 382.5556 525.8889
[178] 487.1111 418.6111 530.4444
[181] 552.4444 480.8333 442.6667
[184] 448.7778 498.7778 531.6667
[187] 432.1667 453.6667 508.0000
[190] 462.1111 495.7778 409.6667
[193] 451.1111 498.7778 419.0556
[196] 447.2778 478.3333 581.7778
[199] 408.8333 518.0556 441.6111
[202] 412.1111 403.5556 515.6111
[205] 506.6667 455.7222 580.7222
[208] 556.8889 515.3889 466.3333
[211] 456.6111 463.3333 502.7222
[214] 472.6667 442.1111 472.3333
[217] 507.3333 451.8889 582.0556
[220] 411.2778 480.4444 529.3333
[223] 497.6111 462.0556 541.3333
[226] 383.5000 463.5000 510.5000
[229] 525.3333 526.0000 505.5000
[232] 431.0000 385.5556 465.0000
[235] 478.2778 450.3889 482.7778
[238] 485.7222 485.1667 495.5556
[241] 513.7778 444.4444 487.5000
[244] 442.3889 454.3333 457.3333
[247] 440.8333 501.8333 495.5000
[250] 574.4444 515.7778 457.2778
[253] 454.9444 480.1111 483.8333
[256] 457.9444 481.9444 491.5556
[259] 416.3333 448.6111 533.2778
[262] 414.7222 548.8333 416.8333
[265] 479.6111 459.8889 462.6111
[268] 455.1667 430.9444 450.7778
[271] 428.7778 556.8333 522.3333
[274] 524.5556 464.3333 457.9444
[277] 474.9444 466.6667 490.7222
[280] 521.7778 445.5556 500.5556
[283] 507.4444 517.4444 437.1667
[286] 459.3333 403.8889 515.7778
[289] 453.7778 486.7222 485.5556
[292] 443.6667 515.9444 454.1667
[295] 409.3889 458.2222 501.7222
[298] 466.5000 476.5556 526.8333
[301] 552.6667 503.4444 435.2222
[304] 488.3889 526.6111 513.7222
[307] 565.6111 443.7778 556.6111
[310] 489.1667 423.5556 490.5556
[313] 478.3333 490.5000 468.9444
[316] 447.7222 426.3889 484.9444
[319] 484.7222 466.7222 515.2222
[322] 464.7222 471.0000 488.6667
[325] 488.7222 464.0556 444.1667
[328] 482.8333 431.6111 426.8333
[331] 526.2778 529.7778 493.0556
[334] 546.1111 473.8333 429.4444
[337] 633.6667 514.6667 447.1111
[340] 459.4444 522.5556 442.0556
[343] 465.3889 444.6111 420.3889
[346] 442.3889 498.5556 469.9444
[349] 430.8333 549.6111 481.8889
[352] 476.8333 480.0556 460.3889
[355] 494.5000 474.6111 522.4444
[358] 430.4444 457.0556 456.3333
[361] 481.7778 461.6111 505.9444
[364] 538.4444 436.0556 443.5000
[367] 470.8333 454.3889 502.6111
[370] 458.4444 432.0556 508.2778
[373] 489.2778 557.1111 497.9444
[376] 482.6111 439.9444 493.8889
[379] 506.8333 442.9444 491.1667
[382] 527.3333 486.5556 446.3333
[385] 471.3333 477.6111 536.0000
[388] 482.3333 487.9444 477.5556
[391] 465.5556 499.3333 450.5556
[394] 519.5000 528.2778 461.7778
[397] 521.5556 482.2778 499.6667
[400] 479.5556 476.0556 536.0000
[403] 429.3889 488.0556 430.5000
[406] 484.8333 498.0000 475.2222
[409] 547.1111 487.6667 496.3333
[412] 492.4444 507.4444 586.5000
[415] 493.8889 467.4444 562.1111
[418] 490.7778 532.6667 495.3333
[421] 457.8889 524.1111 519.9444
[424] 379.9444 486.5556 496.6111
[427] 464.8333 443.0556 447.6111
[430] 456.5000 412.3889 488.2222
[433] 520.5000 556.0000 515.1667
[436] 477.6111 474.4444 474.6667
[439] 499.3889 448.2222 453.5000
[442] 503.5556 461.3333 468.2222
[445] 496.3889 436.8333 460.3333
[448] 550.0000 466.9444 434.6667
[451] 464.3889 508.7222 480.4444
[454] 463.3889 393.5556 494.1111
[457] 497.6667 465.4444 509.2778
[460] 536.0000 397.1111 567.1667
[463] 464.8889 541.2778 524.9444
[466] 509.3889 529.2778 475.1667
[469] 531.7778 479.2222 532.2778
[472] 520.6111 429.6111 550.7778
[475] 502.6667 496.6667 532.1111
[478] 490.1111 413.7222 498.2778
[481] 481.8333 409.7222 506.2778
[484] 426.8889 476.2222 461.9444
[487] 468.0000 434.3889 479.6667
[490] 528.7778 454.1667 397.8889
[493] 510.4444 523.6111 536.2778
[496] 476.6667 512.6111 479.2778
[499] 562.7778 484.9444 476.0556
[502] 553.8333 432.1667 453.5000
[505] 428.8333 467.7222 476.5556
[508] 531.2222 500.3333 456.0556
[511] 525.3889 385.0000 503.5556
[514] 532.7222 434.4444 493.4444
[517] 434.0556 492.6667 544.0556
[520] 511.4444 492.7222 460.4444
[523] 464.6667 470.3889 450.1667
[526] 571.9444 452.8333 499.9444
[529] 412.4444 566.5000 458.5556
[532] 447.5000 444.9444 490.1667
[535] 478.0000 416.0556 501.0000
[538] 435.7778 446.0000 516.8889
[541] 508.2222 471.4444 551.5000
[544] 459.5556 505.0000 494.3889
[547] 466.3333 468.5000 477.1667
[550] 483.7778 514.1111 439.8889
[553] 461.5000 465.3333 503.6111
[556] 496.8333 442.3889 488.5556
[559] 535.8889 414.6667 503.4444
[562] 485.0556 438.7222 443.6111
[565] 443.2778 502.8889 541.5556
[568] 404.7222 487.2778 527.7778
[571] 464.8333 415.1667 578.3889
[574] 504.8333 495.6111 493.4444
[577] 414.6667 458.5556 448.6111
[580] 496.8889 517.1667 465.6667
[583] 430.4444 451.5000 463.3333
[586] 468.3333 510.7778 390.1111
[589] 468.5000 458.0000 434.2778
[592] 541.1667 502.5556 479.6111
[595] 454.8333 453.3333 515.7778
[598] 502.6667 449.1667 507.3889
[601] 470.7222 458.1667 508.1667
[604] 490.7778 455.7778 511.8333
[607] 465.7222 483.6667 482.8333
[610] 458.0000 458.8333 429.3333
[613] 443.0000 444.8889 506.7778
[616] 490.2778 441.5556 468.2222
[619] 474.0000 529.6111 440.7778
[622] 388.8333 421.1667 534.3333
[625] 531.5000 435.9444 489.3889
[628] 493.0000 423.2778 478.0000
[631] 581.8333 462.0000 453.5000
[634] 547.1111 512.1111 423.5556
[637] 494.0556 433.6111 484.8333
[640] 525.4444 521.5556 468.2222
[643] 496.0556 509.6111 498.5556
[646] 469.2778 567.6667 472.4444
[649] 510.3889 469.9444 515.2778
[652] 547.6111 490.7778 524.8889
[655] 422.8889 536.6111 486.3333
[658] 544.6667 466.6111 467.3889
[661] 418.5556 530.8889 476.0556
[664] 506.2778 472.1111 521.3333
[667] 470.4444 444.9444 446.0000
[670] 439.8889 442.1111 506.5556
[673] 553.8889 501.1111 531.1111
[676] 478.6667 504.2778 431.1667
[679] 412.5556 529.1667 494.6111
[682] 374.6111 487.3889 487.7778
[685] 436.1667 495.8889 432.4444
[688] 486.0000 545.4444 488.5556
[691] 532.0556 513.6111 508.2222
[694] 538.2778 517.7222 538.2222
[697] 477.4444 431.5556 481.4444
[700] 441.3333 484.5556 451.6111
[703] 534.1111 472.1111 434.0000
[706] 488.8333 566.8333 440.1111
[709] 497.4444 518.7222 462.1667
[712] 549.9444 443.6111 425.9444
[715] 511.5556 474.9444 489.3889
[718] 462.3889 467.5000 475.7778
[721] 478.7778 497.2778 557.1667
[724] 488.1111 446.2222 571.6111
[727] 464.2222 476.2222 466.6111
[730] 499.6111 417.3889 440.2222
[733] 401.8333 444.4444 445.3333
[736] 468.2778 495.4444 485.4444
[739] 561.3333 514.1667 542.0000
[742] 514.9444 458.8333 445.6667
[745] 556.5000 459.2222 518.3889
[748] 466.5000 483.4444 486.9444
[751] 516.0000 578.7778 484.8333
[754] 511.0556 466.4444 441.0000
[757] 528.5556 449.8333 447.0556
[760] 588.1111 426.9444 472.7222
[763] 461.2222 452.9444 481.2778
[766] 470.3889 398.1667 459.5556
[769] 553.2222 463.3889 457.3333
[772] 458.2222 518.7222 523.0000
[775] 416.3889 483.3333 553.8889
[778] 530.5556 485.1111 429.3333
[781] 480.4444 502.2222 470.4444
[784] 488.7778 560.7222 561.2778
[787] 526.5556 488.0556 499.9444
[790] 538.0000 399.4444 456.9444
[793] 492.2222 472.9444 467.4444
[796] 490.3333 453.1667 514.8333
[799] 496.5556 490.5556 553.7222
[802] 522.6111 461.3333 525.4444
[805] 479.8889 436.2778 436.0000
[808] 418.7778 543.9444 459.7222
[811] 449.9444 460.9444 454.8889
[814] 447.0000 506.3333 472.5000
[817] 481.2778 533.8333 551.4444
[820] 473.3333 441.0556 457.7222
[823] 472.2222 436.0000 449.6111
[826] 435.2778 488.2778 487.3333
[829] 366.8889 372.1667 544.1111
[832] 476.7778 456.0000 471.3889
[835] 478.5556 391.2778 477.0556
[838] 557.2222 459.7778 471.6111
[841] 584.3333 490.6667 557.4444
[844] 494.0556 558.1111 416.8333
[847] 496.8333 497.4444 457.0000
[850] 479.6667 511.3333 506.5556
[853] 495.4444 533.0000 543.2222
[856] 556.2222 522.0000 466.6111
[859] 471.0000 406.3333 499.6667
[862] 425.8333 436.0000 568.8889
[865] 508.3333 459.1667 493.8333
[868] 489.0000 437.0556 492.3333
[871] 513.3889 430.7778 446.2222
[874] 543.1667 455.1667 491.6111
[877] 548.1667 498.2778 477.3333
[880] 450.7222 531.6667 414.6111
[883] 446.0000 485.4444 493.5556
[886] 447.2778 459.6667 579.5556
[889] 447.6111 476.7778 454.7778
[892] 529.4444 493.5000 470.1667
[895] 469.7222 495.2222 382.0556
[898] 597.3889 451.9444 527.9444
[901] 495.5556 521.7778 439.4444
[904] 444.0556 425.8333 487.1667
[907] 477.2778 468.8333 520.8889
[910] 441.5000 545.5000 533.5000
[913] 469.0000 498.8333 455.6667
[916] 460.5000 445.3333 469.0556
[919] 542.1111 550.5000 498.5000
[922] 459.6111 464.5556 473.8889
[925] 463.1667 395.9444 507.0000
[928] 436.6667 474.3889 479.3333
[931] 492.1667 486.9444 461.5000
[934] 543.7778 555.8889 543.7778
[937] 499.5556 523.6111 401.4444
[940] 479.1667 510.5000 504.1111
[943] 566.2778 485.9444 457.6111
[946] 489.0556 467.7222 503.8889
[949] 471.5556 517.4444 488.8333
[952] 488.2778 496.2222 453.5000
[955] 526.8333 487.1667 440.8333
[958] 436.8333 482.1111 499.2778
[961] 521.8333 497.1111 444.3889
[964] 514.1667 532.3333 566.2778
[967] 459.6111 481.8889 464.5556
[970] 506.4444 480.1111 433.2222
[973] 423.2778 448.5000 520.7222
[976] 526.8333 514.1111 455.8333
[979] 470.5556 424.3333 480.7222
[982] 523.8333 521.8889 423.5000
[985] 481.2778 496.0000 484.7222
[988] 500.6667 509.0556 465.2222
[991] 480.1667 435.4444 491.2778
[994] 513.7222 556.2778 439.6111
[997] 447.8889 387.3889 488.6111
[1000] 500.0000
[ reached getOption("max.print") -- omitted 9000 entries ]
>
>
> quantile(vector,.05)
5%
413.2778
> quantile(vector,.95)
95%
553.2222

SO 90% C.I. is [413.2778,553.2222]

THANKS

FIRST QUESTION IS ANSWERED