ldknn(vwr)
ldknn()所属R语言包:vwr
Run the ldknn algorithm
运行ldknn算法
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The ldknn algorithm is used to detect bias in the composition of a lexical decison task, using k-nearest neighbor classification and the Levenshtein distance metric.
ldknn算法是用来检测偏压的一个词法decison任务的组合物中,使用k-最近邻分类和Levenshtein距离度量。
用法----------Usage----------
ldknn(stimuli, types, reference, k = 1, multicore = FALSE)
参数----------Arguments----------
参数:stimuli
character strings corresponding to the stimuli in the experiment.
实验中的刺激对应的字符串。
参数:types
factor corresponding to the type of each stimulus in the experiment.
每个刺激实验中的类型对应的因子。
参数:reference
a character string giving the reference level. Must be a level of the factor in types
一个字符的字符串,给出的参考电平。必须是一个水平的因子在types
参数:k
a value for the k parameter. Set to 1 by default.
参数k的值。默认情况下,设置为1。
参数:multicore
with multicore=TRUE, ldknn will run on multiple cores simultaneously.
在多核= TRUE,ldknn将运行在多个内核上同时进行。
Details
详细信息----------Details----------
Combining k nearest neighbor classification with the Levenshtein distance produces an algorithm which can be described as follows. For an experiment containing a number of stimuli, which can be words or nonwords: <ol> Compute the Levenshtein distances between the currently presented stimulus and all previously presented stimuli.
结合Levenshtein距离k近邻分类产生算法,可以被描述如下。对于含有一些,这种刺激可以是字词或非词进行:<ol>计算当前呈现的刺激和所有先前呈现的刺激之间的Levenshtein距离的实验。
Identify the previously presented stimuli that are at the k nearest distances from the current stimulus.
确定先前提出的刺激,是在k个最近的距离从目前的刺激。
Compute the probability of a word response for the given stimulus based on the relative frequency of words among the nearest neighbors. </ol>
计算词语的近邻之间的相对频度为给定的刺激的基础上一个字响应的概率。 </ OL>
值----------Value----------
A list with class ldknn.run. <table summary="R valueblock"> <tr valign="top"><td>data</td> <td> A data frame containing the results of the run. stimulus gives the stimulus values, type gives the types of the stimuli, p gives the probability for a reference.level response for that stimulus.</td></tr> <tr valign="top"><td>reference level</td> <td> The reference level used for the simulation.</td></tr> <tr valign="top"><td>Odds</td> <td> The odds, z value, and p value for a reference level response, resulting from a logistic regression in which the probabilities generated by the ldknn algorithm are used to predict stimulus types.</td></tr> </table> plot and print methods are available for objects of class ld1nn.run
的列表类ldknn.run。 <table summary="R valueblock"> <tr valign="top"> <TD>data</ TD> <td>一个数据框包含的运行结果。 stimulus给出的刺激值,type给出了类型的刺激,p给reference.level该刺激的响应的概率。</ TD> </ TR> <tr valign="top"> <TD> reference level </ TD> <TD>用于仿真的参考电平。</ TD> </ TR> <tr valign="top"> <TD> Odds</ TD> <TD>的赔率,参考电平响应,Z值,p值logistic回归的概率被用来预测所产生的ldknn算法的刺激类型。</ TD> </ TR> </ TABLE>plot和print方法是对象的类ld1nn.run
(作者)----------Author(s)----------
Emmanuel Keuleers
参考文献----------References----------
Keuleers, E., & Brysbaert, M. (manuscript submitted for publication). Detecting inherent bias in lexical decision experiments with the LD1NN algorithm.
参见----------See Also----------
levenshtein.distance
levenshtein.distance
实例----------Examples----------
data(english.words)
data(basque.words)
# set up a mock experiment: English stimuli are words, Basque stimuli are nonwords[设置了一个模拟实验:英语的刺激的话,巴斯克刺激非词]
experiment<-data.frame(stimulus=c(sample(english.words,500),
sample(basque.words,500)),
type=factor(rep(c('Word','Nonword'),each=500),levels=c('Word','Nonword')))
# randomize the trials[随机试验]
experiment<-experiment[sample(1:1000,1000),]
# run the ldknn algorithm[运行ldknn算法]
results<-ldknn(experiment$stimulus,experiment$type,'Word')
print(results)
plot(results)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|