Description Usage Arguments Details Value Author(s) See Also Examples
Adds the weights associated with the responses to the items to a data frame.
1 | addweights(obj, weightsfile = NULL, weightsdata = NULL)
|
obj |
An object containing the data imported by function |
weightsfile |
the name of the file with the weights. Column names should match the names of the items. |
weightsdata |
an R data frame containing the weights. Column names should match the names of the items. |
If weightsfile
and weightsdata
have only one row, they should contain the weights that
are assigned to the correct responses. These are defined by addkey
.
To specify a different weight to every response of each item, weightsfile
and weightsdata
should have one row for each response. In this case there should be a field named response
.
weightsfile
and weightsdata
can contain more items than obj
.
In this case, items not contained in obj
are dropped in the output.
A list with data
, eventually key
, and weights
.
Michela Battauz
1 2 3 4 5 6 7 | data(test)
data(key)
data(weights)
data(weights_multiple)
testk <- addkey(test, keydata = key)
testw <- addweights(testk, weightsdata = weights)
testwm <- addweights(test, weightsdata = weights_multiple)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.