首页 > 其他分享 >Power and sample size应用在概率题

Power and sample size应用在概率题

时间:2024-05-30 13:25:52浏览次数:25  
标签:femur cm Power males height sample implied male size

Statistical power

统计功效是统计检验否定假原假设的概率。


我们把拒绝正确null hypothsis的错误称为type I error (\(\alpha\))
把没有拒绝错误的null hypothesis的错误称为type II error (\(\beta\))

Sample size

1. Bioarchaeology

H0: thw owner of the femur was female
Ha: the owner of the femur was male

male_mean <- 167.4
female_mean <- 155.3
male_std <- 5.5
female_std <- 5.2
femur_owner <- 42.8/0.2674
femur_owner

beta<- pnorm(femur_owner,mean=male_mean,sd=male_std)
alpha <- 1- pnorm(femur_owner,mean = female_mean,sd=female_std)
print(alpha)
print(beta)

The alpha present the type I error probobility if we do reject the H0 (0.180032), and beta present the type I error probobility.

knitr::opts_chunk$set(echo = TRUE)

Analysis of Prehistoric Human Remains

Introduction

In this report, we aim to analyze the remains of a prehistoric human population, specifically a single femur bone found during an excavation. The archaeologists have provided information about the average height distribution of males and females from previous findings. Using this data, we will attempt to estimate the sex of the individual based on the length of the femur and provide a measure of confidence in our estimation. Additionally, we will suggest steps that should be taken to confirm the estimate.

Data

The given data is as follows:

  • Average height (in cm) by sex (male or female) is normally distributed.
  • Mean height for males: 167.4 cm
  • Standard deviation for males: 5.5 cm
  • Mean height for females: 155.3 cm
  • Standard deviation for females: 5.2 cm
  • Length of the femur found: 42.8 cm
  • The femur is typically 26.74% of a person's height.

Analysis

To estimate the sex of the individual based on the length of the femur, we need to calculate the height implied by the femur length and compare it with the height distributions of males and females.

# Calculate the implied height from the femur length
implied_height <- 42.8 / 0.2674

# Print the implied height
implied_height

The implied height from the femur length is r round(implied_height, 2) cm.

Next, we need to calculate the z-scores for the implied height with respect to the male and female height distributions. The z-score represents the number of standard deviations the implied height is away from the mean of each distribution.

# Calculate z-scores
z_score_male <- (implied_height - 167.4) / 5.5
z_score_female <- (implied_height - 155.3) / 5.2

# Print z-scores
cat("Z-score for males:", round(z_score_male, 2), "\n")
cat("Z-score for females:", round(z_score_female, 2), "\n")

这里最后的解释不太对,辩证看待

# Calculate probabilities
prob_male <- pnorm(implied_height, mean = 167.4, sd = 5.5, lower.tail = FALSE)
prob_female <- pnorm(implied_height, mean = 155.3, sd = 5.2, lower.tail = FALSE)

# Print probabilities
cat("Probability of observing this height or greater for males:", round(prob_male, 4), "\n")
cat("Probability of observing this height or greater for females:", round(prob_female, 4), "\n")

The probability of observing a height equal to or greater than the implied height is r round(prob_male, 4) for males and r round(prob_female, 4) for females. Since the probability for males is higher, we can be more confident in our estimate that the individual was male.

标签:femur,cm,Power,males,height,sample,implied,male,size
From: https://www.cnblogs.com/chen-heybro/p/18207382

相关文章

  • E.Power of Points
    题目:链接:https://www.luogu.com.cn/problem/CF1857Eorhttps://codeforces.com/problemset/problem/1857/E思路我的思路可能比较复杂:首先由于覆盖的是整点,那么可以想到排序后用前缀和,比如143-->134然后由于区间[a,b]的整点数是b-a+1,那么该点的数量就是注意:这里的......
  • PowerMock入门:Java单元测试的终极武器
    在软件开发过程中,单元测试是确保代码质量的重要环节。它帮助开发者验证代码的各个部分是否按照预期工作,从而提高软件的稳定性和可维护性。然而,传统的单元测试工具,如JUnit和Mockito,虽然功能强大,但在某些场景下却显得力不从心。例如,它们在模拟静态方法、私有方法、构造函数以......
  • dotnet c# samples core nativeaot NativeLibrary
     如何在System.Text.Json中使用源生成 https://learn.microsoft.com/zh-cn/dotnet/standard/serialization/system-text-json/source-generation?pivots=dotnet-8-0 https://github.com/dotnet/samples/tree/main/core/nativeaot/NativeLibrary   ......
  • 关于size_t
    size_t是什么?为什么要使用它?首先,我们给出size_t的定义:size_t的全称是sizetype,即“记录大小的数据类型”,是sizeof运算结果的类型,一个unsigned整型。以防万一,sizeof(chr)返回的是变量或类型在内存中占用的字节数。size_t被用在哪里?c库中的许多函数会使用size_t,请看如下函数......
  • powerbuildr中如何使用dblink连接的表
    powerbuilder中如何使用dblink跨库中的表在powerbuilder中使用查询语句并返回值1、定义变量intll_rtn//返回值stringls_sql,ls_where //sql变量和where条件2、写dblink关联表ls_sql="selectcount(1)fromtable1@dblinka"+'~r~n'+& "innerjointable2@dblink......
  • PowerShell 命令 Get-NetConnectionProfile 来查看当前网络连接的类型。命令会列出当
    PowerShell命令Get-NetConnectionProfile来查看当前网络连接的类型。在PowerShell中执行以下命令:powershellCopyCodeGet-NetConnectionProfile这个命令会列出当前计算机上所有网络连接的详细信息,包括连接名称、接入类型(例如“域网络”、“专用网络”、“公用网络”)等。在......
  • PowerShell 中重置SQL SERVER数据库的 SA(System Administrator)密码可以通过 SQL Serve
    PowerShell中重置数据库的SA(SystemAdministrator)密码可以通过SQLServerManagementObjects(SMO)来完成。以下是一个基本的PowerShell脚本,可以用来重置SA用户的密码:powershellCopyCode#导入SQLServer模块Import-ModuleSQLPS-DisableNameChecking#设置SQL......
  • Python 将PowerPoint (PPT/PPTX) 转为HTML
    1.Python 将PowerPoint文档转为HTML格式要实现该转换,仅需加一个.ppt或.pptx文档,然后使用 Presentation.SaveToFile() 方法将其另存为HTML格式。fromspire.presentation.commonimport*fromspire.presentationimport*#加载PPT文档ppt=Presentation()ppt.L......
  • powershell脚本批量拉取 git仓库文件
    #定义基础URL和数据库列表$BASE_URL="http://8.8.11.99:8999/yaya/"$DATABASES="common-service","bi-system","erp","gateway","pdm","plm","public-service","scm",&quo......
  • pg调整wal_segment_size(默认是16MB)大小
    环境:OS:Centos7DB:pg14pg默认的wal_segment_size是16MB,下面可以通过如下命令修改 1.关闭数据库systemctlstoppostgresql-14 2.修改wal默认大小[root@dsc1bin]#/usr/pgsql-14/bin/pg_resetwal--wal-segsize=64-D/opt/pg14/datapg_resetwal:error:cannotbeexec......