当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


R OME OME 儿童的听觉测试


R语言 OME 位于 MASS 包(package)。

说明

针对儿童区分broad-band 噪声中的信号的能力进行了实验。噪声从一对扬声器播放,信号仅添加到一个通道;受试者必须将他/她的头转向带有添加信号的频道。信号或者是相干的(噪声幅度在一段时间内增加),或者是不相干的(在同一周期内添加独立噪声以形成相同的功率增加)。

原始分析中使用的阈值是获得 75% 正确响应所需的刺激响度。一些儿童患有渗出性中耳炎(OME)。

用法

OME

格式

OME DataFrame 有 1129 行和 7 列:

ID

主题 ID(1 到 99,部分 ID 缺失)。一些受试者在不同年龄进行了测量。

OME

"low""high""N/A"(30 个月和 60 个月以外的年龄)。

Age

受试者的年龄(月)。

Loud

刺激的响度,以分贝为单位。

Noise

刺激中的信号是 "coherent" 还是 "incoherent"

Correct

Trials 试验的正确响应数。

Trials

进行的试验次数。

背景

该实验旨在研究渗出性中耳炎 (OME),这是一种非常常见的儿童疾病,通常为 air-filled 的中耳空间因液体而充血。伴随的波动性传导性听力损失可能导致各种语言、认知和社交缺陷。 “双耳听力”一词用于说明大脑同时处理来自双耳的信息的听力条件。大脑计算到达每只耳朵的信号强度和/或时间的差异,这有助于声音定位以及我们在背景噪音中听到的能力。

几年前,人们发现有明显 OME 病史的 7-8 岁儿童的双耳听力明显比没有这种病史的儿童差,尽管其敏感性相当。问题仍然在于关键时期中耳炎发作的时间、持续时间或严重程度是否影响了后来的双耳听力。为了开始回答这个问题,95 名儿童自出生以来每个月都接受了积液监测。根据头两年的 OME 经验,测试人群被分为一组 OME 患病率高的组和一组低患病率的组。

例子

# Fit logistic curve from p = 0.5 to p = 1.0
fp1 <- deriv(~ 0.5 + 0.5/(1 + exp(-(x-L75)/scal)),
             c("L75", "scal"),
             function(x,L75,scal)NULL)
nls(Correct/Trials ~ fp1(Loud, L75, scal), data = OME,
    start = c(L75=45, scal=3))
nls(Correct/Trials ~ fp1(Loud, L75, scal),
    data = OME[OME$Noise == "coherent",],
    start=c(L75=45, scal=3))
nls(Correct/Trials ~ fp1(Loud, L75, scal),
    data = OME[OME$Noise == "incoherent",],
    start = c(L75=45, scal=3))

# individual fits for each experiment

aa <- factor(OME$Age)
ab <- 10*OME$ID + unclass(aa)
ac <- unclass(factor(ab))
OME$UID <- as.vector(ac)
OME$UIDn <- OME$UID + 0.1*(OME$Noise == "incoherent")
rm(aa, ab, ac)
OMEi <- OME

library(nlme)
fp2 <- deriv(~ 0.5 + 0.5/(1 + exp(-(x-L75)/2)),
            "L75", function(x,L75) NULL)
dec <- getOption("OutDec")
options(show.error.messages = FALSE, OutDec=".")
OMEi.nls <- nlsList(Correct/Trials ~ fp2(Loud, L75) | UIDn,
   data = OMEi, start = list(L75=45), control = list(maxiter=100))
options(show.error.messages = TRUE, OutDec=dec)
tmp <- sapply(OMEi.nls, function(X)
              {if(is.null(X)) NA else as.vector(coef(X))})
OMEif <- data.frame(UID = round(as.numeric((names(tmp)))),
         Noise = rep(c("coherent", "incoherent"), 110),
         L75 = as.vector(tmp), stringsAsFactors = TRUE)
OMEif$Age <- OME$Age[match(OMEif$UID, OME$UID)]
OMEif$OME <- OME$OME[match(OMEif$UID, OME$UID)]
OMEif <- OMEif[OMEif$L75 > 30,]
summary(lm(L75 ~ Noise/Age, data = OMEif, na.action = na.omit))
summary(lm(L75 ~ Noise/(Age + OME), data = OMEif,
           subset = (Age >= 30 & Age <= 60),
           na.action = na.omit), correlation = FALSE)

# Or fit by weighted least squares
fpl75 <- deriv(~ sqrt(n)*(r/n - 0.5 - 0.5/(1 + exp(-(x-L75)/scal))),
               c("L75", "scal"),
               function(r,n,x,L75,scal) NULL)
nls(0 ~ fpl75(Correct, Trials, Loud, L75, scal),
    data = OME[OME$Noise == "coherent",],
    start = c(L75=45, scal=3))
nls(0 ~ fpl75(Correct, Trials, Loud, L75, scal),
    data = OME[OME$Noise == "incoherent",],
    start = c(L75=45, scal=3))

# Test to see if the curves shift with age
fpl75age <- deriv(~sqrt(n)*(r/n -  0.5 - 0.5/(1 +
                  exp(-(x-L75-slope*age)/scal))),
                  c("L75", "slope", "scal"),
                  function(r,n,x,age,L75,slope,scal) NULL)
OME.nls1 <-
nls(0 ~ fpl75age(Correct, Trials, Loud, Age, L75, slope, scal),
    data = OME[OME$Noise == "coherent",],
    start = c(L75=45, slope=0, scal=2))
sqrt(diag(vcov(OME.nls1)))

OME.nls2 <-
nls(0 ~ fpl75age(Correct, Trials, Loud, Age, L75, slope, scal),
    data = OME[OME$Noise == "incoherent",],
    start = c(L75=45, slope=0, scal=2))
sqrt(diag(vcov(OME.nls2)))

# Now allow random effects by using NLME
OMEf <- OME[rep(1:nrow(OME), OME$Trials),]
OMEf$Resp <- with(OME, rep(rep(c(1,0), length(Trials)),
                          t(cbind(Correct, Trials-Correct))))
OMEf <- OMEf[, -match(c("Correct", "Trials"), names(OMEf))]

## Not run: ## these fail in R on most platforms
fp2 <- deriv(~ 0.5 + 0.5/(1 + exp(-(x-L75)/exp(lsc))),
             c("L75", "lsc"),
             function(x, L75, lsc) NULL)
try(summary(nlme(Resp ~ fp2(Loud, L75, lsc),
     fixed = list(L75 ~ Age, lsc ~ 1),
     random = L75 + lsc ~ 1 | UID,
     data = OMEf[OMEf$Noise == "coherent",], method = "ML",
     start = list(fixed=c(L75=c(48.7, -0.03), lsc=0.24)), verbose = TRUE)))

try(summary(nlme(Resp ~ fp2(Loud, L75, lsc),
     fixed = list(L75 ~ Age, lsc ~ 1),
     random = L75 + lsc ~ 1 | UID,
     data = OMEf[OMEf$Noise == "incoherent",], method = "ML",
     start = list(fixed=c(L75=c(41.5, -0.1), lsc=0)), verbose = TRUE)))

## End(Not run)

来源

Sarah Hogan,牛津大学生理学系,来自统计咨询服务部

相关用法


注:本文由纯净天空筛选整理自R-devel大神的英文原创作品 Tests of Auditory Perception in Children with OME。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。