meanSum {petersenlab} | R Documentation |
Mean Sum.
Description
Compute a missingness-adjusted row sum.
Usage
meanSum(x)
Arguments
x |
Matrix or dataframe with participants in the rows and items in the columns. |
Details
Take row mean across columns (items) and then multiply by number of items to
account for missing (NA
) values.
Value
Missingness-adjusted row sum.
See Also
Other computations:
Mode()
,
mySum()
Examples
# Prepare Data
df <- data.frame(item1 = rnorm(1000), item2 = rnorm(1000), item3 = rnorm(1000))
# Calculate Missingness-Adjusted Row Sum
df$missingnessAdjustedSum <- meanSum(df)
[Package petersenlab version 1.0.0 Index]