Is it better in terms of type i and type ii error to delete

Assignment Help Other Subject
Reference no: EM132277587

Question: Is it better in terms of Type I and Type II error to delete tied values or to use the midrank correction?

Use at least three different sample sizes, two different significance levels, two values of "d", two different distributions, and 10% versus 30% tied values.

Use any test in Chapters 2 - 7 of the text, except for Wilcoxon rank sum, Siegel-Tukey, and two-sample t-test.

Useful code:

## Power for sign test vs. t-test if the distribution is normal

require(coin)

require(rmutil)

powerFun.norm <- function(n,d=1,p=0.5,alpha=0.05,sigma=1,nsims=1000)

{

pval.sign <- numeric(nsims)

pval.t <- numeric(nsims)

pval.wsr <- numeric(nsims)

for (i in 1:nsims) {

dat1 <- rnorm(n,mean=0,sd=sigma)

dat2 <- rnorm(n,mean=d,sd=sigma)

diff <- dat2-dat1

ts <- length(diff[diff > 0])

pval.sign[i] <- binom.test(ts,n)$p.value

pval.wsr[i] <- pvalue(wilcoxsign_test(dat2~dat1))

pval.t[i] <- t.test(diff)$p.value

}

power.sign <- length(pval.sign[pval.sign < alpha])/nsims

power.wsr <- length(pval.wsr[pval.wsr < alpha])/nsims

power.t <- length(pval.t[pval.t < alpha])/nsims

return(list(sign = power.sign, WSR = power.wsr, t=power.t))

}

powerFun.norm(10)

powerFun.norm(20)

# Underlying distribution is exponential

powerFun.exp <- function(n,d=0.5,p=0.5,alpha=0.05,sigma=1,nsims=1000)

{

pval.sign <- numeric(nsims)

pval.t <- numeric(nsims)

pval.wsr <- numeric(nsims)

for (i in 1:nsims) {

dat1 <- rexp(n,rate=1)

dat2 <- rexp(n,rate=d)

diff <- dat2-dat1

ts <- length(diff[diff > 0])

pval.sign[i] <- binom.test(ts,n)$p.value

pval.wsr[i] <- pvalue(wilcoxsign_test(dat2~dat1))

pval.t[i] <- t.test(diff, mu=1)$p.value

}

power.sign <- length(pval.sign[pval.sign < alpha])/nsims

power.wsr <- length(pval.wsr[pval.wsr < alpha])/nsims

power.t <- length(pval.t[pval.t < alpha])/nsims

return(list(sign = power.sign, WSR = power.wsr, t=power.t))

}

powerFun.exp(10)

powerFun.exp(20)

powerFun.dexp <- function(n,d=1,p=0.5,alpha=0.05,sigma=1,nsims=1000)

{

pval.sign <- numeric(nsims)

pval.t <- numeric(nsims)

pval.wsr <- numeric(nsims)

for (i in 1:nsims) {

dat1 <- rlaplace(n,m=0,s=sigma)

dat2 <- rlaplace(n,m=d,s=sigma)

diff <- dat2-dat1

ts <- length(diff[diff > 0])

pval.sign[i] <- binom.test(ts,n)$p.value

pval.wsr[i] <- pvalue(wilcoxsign_test(dat2~dat1))

pval.t[i] <- t.test(diff)$p.value

}

power.sign <- length(pval.sign[pval.sign < alpha])/nsims

power.wsr <- length(pval.wsr[pval.wsr < alpha])/nsims

power.t <- length(pval.t[pval.t < alpha])/nsims

return(list(sign = power.sign, WSR = power.wsr, t=power.t))

}

powerFun.dexp(10)

powerFun.dexp(20)

Reference no: EM132277587

Questions Cloud

Discuss the ethical reasoning of opposing perspectives : Theory and Practice in the Global Workplace will be the most challenging for me to demonstrate mastery of for my course outcomes.
Case study - escaping the discount trap : Case Study : Escaping the Discount Trap - Should the company abandon solutions selling for some of its customers What can we do in our context
Assignments require students to use scholarly sources : Many college assignments require students to use scholarly sources.
Create an outline of the argument paper : Create an outline of your argument paper using the Argument Paper Outline Template. Complete the following areas of the Argument Paper Outline Template.
Is it better in terms of type i and type ii error to delete : Is it better in terms of Type I and Type II error to delete tied values or to use the midrank correction?
Focuses on advising companies on strategy : John Sutherland needs your help. John is the founder and CEO of a midsized global consulting firm that focuses on advising companies on strategy
Process during the continuous improvement cycle : Why is it desirable to stabilize the process during the continuous improvement cycle?
How the services provide to their beneficiaries : How the services provide to their Beneficiaries? Who administrates Medicare? How?
Consideration when determining target inventory levels : The lead time must be taken into consideration when determining target inventory levels.

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd