Exercise 2Python

Java Python 1.Table 1 is a 2×2×2 contingency table which studied the effects of racial charac- teristics on the death penalty verdict.The victims'race (V),defendants'race (D) and death penalty(P)are three binary variables.

Table 1:Death penalty verdict by defendants race and victims race

Death Penalty

Victims'Race

Defendants'Race

Yes

No

White

White

53

414

Black

11

37

Black

White

1

16

Black

4

139

(a)Hand calculate the expected frequencies,the Pearson chi-square statistic,the   degree of freedom under the total independence of V,D,and P.Report the total independence test result at the 5%significance level.Do you think the test result is appropriate? [5 marks]

(b)Hand calculate the expected frequencies,the Pearson chi-square statistic,the  degree of freedom under the group independence between (V,D)and P.Re- port the group independence test result at the 5%significance level.[5  marks]

(c)Hand calculate the expected frequencies,the Pearson chi-square statistic,the  degree of freedom under the conditional independence between D and P given V.Report the conditional independence test result at the 5%significance level. [5 marks]

(d)Hand calculate the expected frequencies,the Pearson chi-square statistic,the   degree of freedom under the marginal independence between V and P.Report  the marginal independence test result at the 5%significance level.[5 marks]

(e)Comment on the test results. [5  marks]

[Total:25 marks]

2.The   dataset    Neuralgia   contains    five   variables:Treatment,Sex,Age,Duration, and  Pain.The  last  variable,Pain=Yes,No,is  the  response  variable.Treatment  is a categorical variable with three levels A,B and P.Sex represents the gender of the patients and has two levels F and M.The Age and Duration are two continuous variables.The SAS outputs from the SAS proc logistic are given as follows.

Response Profile

Ordered Value

Pain

Total Frequency

1

No

35

2

Yes

25

Probability modeled is Pain='No'.

Class Level Information

Class

Value

Design Variables

Treatment

A

0

B

0

1

P

0

0

Sex

F

1

M

0

Testing Global Null Hypothesis:BETA=0

Test

Chi-Square

DF

Pr>ChiSo

Likelihood Ratio

32.9074

7

<.0001

Score

25.6812

7

0.0006

Wald

14.2879

7

0.0463

Analysis of Maximum Likelihood Estimates

Parameter

DF

Fstimate

Standard Error

Wald Chi-Square

Pr>ChiSq

Intercept

1

15.8108

6.6978

5.5725

0.0182

Treatment

A

3.5448

1.5135

5.4853

0.0192

Treatment

B

3.9417

1.6123

5.9771

0.0145

Sex

F

1

2.1392

1.3958

2.3490

0.1254

Treatment*Sex

A

F

-0.7067

1.9377

0.1330

0.7153

Treatment*Sex

B

F

-0.2072

1.9361

0.0114

0.9148

Age

-0.2688

0.0996

7.2744

0.0070

Duration

0.00523

0.0333

0.0247

0.8752

(a)The procedure models the probability of which event?Write down the fitted logistic model                    [4  marks]

(b)What is the null hypothesis for Global Null Hypothesis?Report the global null hypothesis test result at the  5%significance level.Is the  sample  size sufficiently large?                   [4 marks]

(c)Consider the following two patients with

(i)Treatment=P,Sex=M,Age=30,Duration=5; (ii)Treatment=B,Sex=F,Age=50,Duration=10.

Write down the coefficients of contrast for patient (i);patient (ii);and (i)vs (ii).Report  the  odds  ratio  of  (i)vs  (ii)as  well  as  the  corresponding  95% confidence interval and provide appropriate interpretations. [9 marks]

(d)What is the null hypothesis for the following TEST statement?

test  SexF  +TreatmentASexF  =0,SexF  +TreatmentBSexF  =0;

Report the test result at the 5%significance level. [4 marks]

(e)Report the result of the Hosmer-Lemeshow lack-of-fit test at the 5%signif- cance level.The lack-of-fit test yields p=0.4390 for the probit link function         

  • 22
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
校园失物招领系统管理系统按照操作主体分为管理员和用户。管理员的功能包括字典管理、论坛管理、公告信息管理、失物招领管理、失物认领管理、寻物启示管理、寻物认领管理、用户管理、管理员管理。用户的功能等。该系统采用了Mysql数据库,Java语言,Spring Boot框架等技术进行编程实现。 校园失物招领系统管理系统可以提高校园失物招领系统信息管理问题的解决效率,优化校园失物招领系统信息处理流程,保证校园失物招领系统信息数据的安全,它是一个非常可靠,非常安全的应用程序。 ,管理员权限操作的功能包括管理公告,管理校园失物招领系统信息,包括失物招领管理,培训管理,寻物启事管理,薪资管理等,可以管理公告。 失物招领管理界面,管理员在失物招领管理界面中可以对界面中显示,可以对失物招领信息的失物招领状态进行查看,可以添加新的失物招领信息等。寻物启事管理界面,管理员在寻物启事管理界面中查看寻物启事种类信息,寻物启事描述信息,新增寻物启事信息等。公告管理界面,管理员在公告管理界面中新增公告,可以删除公告。公告类型管理界面,管理员在公告类型管理界面查看公告的工作状态,可以对公告的数据进行导出,可以添加新公告的信息,可以编辑公告信息,删除公告信息。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值