ndlCuesOutcomes {ndl} | R Documentation |
Creation of dataframe for Naive Discriminative Learning from formula specification
Description
ndlCuesOutcomes
creates a dataframe for fitting a naive
discriminative classification model with ndlClassify
, using
the specified formula and provided data.
Usage
ndlCuesOutcomes(formula, data, frequency=NA,
numeric2discrete=function(x) Hmisc::cut2(x,g=g.numeric), g.numeric=2,
check.values=TRUE, ignore.absent=NULL, variable.value.separator="", ...)
Arguments
formula |
An object of class |
data |
A data frame containing the variables in the model. |
frequency |
A numeric vector (or the name of a column in the input data frame) with the frequencies of the exemplars. If absent, each exemplar is assigned a frequency equal to 1. |
numeric2discrete |
A function to transform a continuous numeric predictor into a
number of discrete classes, by default |
g.numeric |
A parameter to be passed to the |
check.values |
A logical specifying whether underscores ‘_’ in predictor
values should substituted with periods ‘.’; if |
ignore.absent |
A character vector specifying one or more values for any predictor
(e.g. |
variable.value.separator |
A character string which will separate variable names from
variable values in their combination as cue values; by default an
empty character string ( |
... |
Control arguments to be passed along to |
Details
Creates a dataframe to be used for fitting a Naive Discriminatory Learning classifier model.
Value
A dataframe with the following columns:
Frequency
Frequency with which the specific Cues and Outcomes co-occur.
Cues
A character vector of sets of Cues per instance, with Cues separated by underscore ‘_’.
Outcomes
A character vector of Outcomes per instance.
Author(s)
R. H. Baayen and Antti Arppe
References
Arppe, A. and Baayen, R. H. (in prep.) Statistical modeling and the principles of human learning.
See Also
Examples
data(think)
set.seed(314)
think <- think[sample(1:nrow(think),500),]
think.CuesOutcomes <- ndlCuesOutcomes(Lexeme ~ (Person * Number * Agent) + Register,
data=think)
head(think.CuesOutcomes)
## Not run:
data(dative)
dative.cuesOutcomes <- ndlCuesOutcomes(RealizationOfRecipient ~ LengthOfRecipient +
LengthOfTheme, data=dative, numeric2discrete=NULL)
table(dative.cuesOutcomes$Cues)
dative.cuesOutcomes1 <- ndlCuesOutcomes(RealizationOfRecipient ~ LengthOfRecipient +
LengthOfTheme, data=dative)
table(dative.cuesOutcomes1$Cues)
dative.cuesOutcomes2 <- ndlCuesOutcomes(RealizationOfRecipient ~ LengthOfRecipient +
LengthOfTheme, data=dative, g.numeric=3)
table(dative.cuesOutcomes2$Cues)
## End(Not run)