Dayvon B.

asked • 02/12/24

Rather than using the test statistic...

A company that sells its product on their website would like to improve the sales by making the webpage with product info more attractive. Current version (call it version A) and a new version (call it version B) are compared. A JavaScript code randomly chooses one of the two versions of the website to load to each customer that clicks on the link to the page about the product.

Each version of the page has Buy  button that leads the customer to purchase the product online. The company would like to test whether the new version (B) is better than the old one (A) by comparing the true probabilities pA and pB of purchasing the product for a randomly chosen visit of each website.

Let 𝑝_𝐴 be probability that a randomly chosen visitor of website version 𝐴 buys the product from the website. Similarly, let 𝑝_𝐵 be the corresponding probability for version 𝐵. Let 𝑛_1 and 𝑛_2 be sample sizes of the visitors of versions 𝐴 and 𝐵, respectively. Also, denote by 𝑋_1 and 𝑋_2 the numbers of visitors in the two samples who purchased the product, as well as sample proportions 𝑝̂_𝐴 = (𝑋_1)/(𝑛_1) and 𝑝̂_𝐵 = (𝑋_2)/(n_2).


Part b)

Rather than using the test statistic 𝑝̂ 𝐴−𝑝̂ 𝐵�^�−�^�, we can use its standardized version


𝑍=𝑝̂ 𝐴−𝑝̂ 𝐵−𝜇𝑝̂ 𝐴−𝑝̂ 𝐵𝜎𝑝̂ 𝐴−𝑝̂ 𝐵,�=�^�−�^�−��^�−�^���^�−�^�,

where 𝜇𝑝̂ 𝐴−𝑝̂ 𝐵=𝑝𝐴−𝑝𝐵��^�−�^�=��−��,

and


𝜎2𝑝̂ 𝐴−𝑝̂ 𝐵=why?𝜎2𝑝̂ 𝐴+𝜎2𝑝̂ 𝐵=𝑝𝐴(1−𝑝𝐴)𝑛1+𝑝𝐵(1−𝑝𝐵)𝑛2.��^�−�^�2=why?��^�2+��^�2=��(1−��)�1+��(1−��)�2.


For large sample sizes 𝑛_1 and 𝑛_2, we would like to approximate 𝑍 as standard normal: 𝑍 ≈ N(0;1). Which of the following assumptions must hold, in order for us to justify the use of the statistic 𝑍 and this normal approximation? Do NOT include in your answer statements that are true but are not needed here.


  1. Sample proportions 𝑝̂_𝐴 and 𝑝̂_𝐵 are sample means of some samples (from B𝑒𝑟𝑛𝑜𝑢𝑙𝑙𝑖(𝑝𝐴) and B𝑒𝑟𝑛𝑜𝑢𝑙𝑙𝑖(𝑝𝐵), respectively).


2.By Central Limit Theorem, for 𝑛_1 and 𝑛_2 large, each of 𝑝̂_𝐴 and 𝑝̂_𝐵 is approximately normally distributed.


3.The two samples are independent of each other.


4.The sum of two independent binomial random variables is another binomial random variable.


5.Linear combination of independent normal random variables is a normal random variable


6.For any normal variable 𝑋~N(𝜇𝑋;𝜎2𝑋) we have (𝑋−𝜇_𝑋)/(𝜎_𝑋) ~ N0;1).


7.Two wrongs don't make a right.


8.Pineapple goes well on pizza. 🍕


Create an R variable ansb which is equal to the vector that consists exactly of those integers whose corresponding statement is used for concluding that 𝑍 is approximately standard normal. For example, if you think that exactly 1st and 7th statements are used (and no other), you should write

ansb = c(1,7)


My code (R):

```

ansi = c(2,6)


```


Feel free to correct my code with the appropriate answer to this question.


Make sure your code passes ALL test provided by the following code:


```

## check whether variable ansb is numeric vector and of length 5


if (test_that(desc="", code={

expect_equal(exists("ansb", mode="numeric"), TRUE)

}) != TRUE) stop("ans not created or is not numeric!")



if (test_that(desc="", code={

expect_equal(length(ansb), 5)

}) != TRUE) stop("ans not created or is not numeric!")


```


1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.