View source: R/rrwRunWithFixedParameters.r
rrwRunWithFixedParameters | R Documentation |
Function that runs a set of fixed parameters (specified in a rrwModelList) to generate the fits to the data.
rrwRunWithFixedParameters(
data,
rrwModelList,
minN = 20,
dataOverlapCol = "overlapRound",
RwSamplesCol = "Q50",
dataRtCol = "rt",
correctCol = "correct",
correctVals = c(TRUE, FALSE),
loopsPerRWstep = 200,
minimizeStat = "BIC",
equalizeRTandPhit = FALSE,
pars.n = NULL,
fileTag = NULL,
numSimsToAverage = 10,
...
)
data |
This is a dataframe containing the raw trial-by-trial data that must contain the following columns: overlap; RT (often a median); the proportion correct/incorrect; whether or not the row specifies a correct or incorrect trial. The dataset can also contains columns that effect code the influence of different parameters. |
rrwModelList |
A list that specifies the rrw model. Build the rrwModelList useing rrwAddEffectToRRWModel |
minN |
A a numeric value that specifies the minimum number of trials necessary for a condition to be included in the analysis. If the condition has less than minN trials, then that condition is assigned and NA. Default=20 |
dataOverlapCol |
A string that identifies the name of the column in data that contains the distributional overlaps for each row. The default is "overlap" |
RwSamplesCol |
A string that identifies the name of the column in the RRW simulations that contains the summary of the samples that you want to use as a simulation for RT. The possible columns are: "Q25" (the 25th quartile); "Q50" (the median); "mean" (the mean); "Q75" (the 75th quartile). The default is "Q50" because the median is more robust than the mean. |
dataRtCol |
A string that identifies the name of the column in data that contains the RTs for the specific overlap/correct/condition combination. Default is "rt" |
correctCol |
a string that specifies the name of the column that specifies if the participant chose the item with the greatest value distribution (correct) or if they did not (incorrect). |
correctVals |
a vector of two values that specifies the "correct" value (index 1) and the "incorrect" value (index 2). e.g, c("yes", "no"). DEFAULT = c(TRUE, FALSE) |
loopsPerRWstep |
A number specifying the number of loops that will be run in the RRW simulation when it calculates the summary statistics for each number of samples for each boundary. Higher numbers produce more precise estimates, but also increase the time needed to converge on a solution. Default is 200. |
minimizeStat |
A string that specifies which statistic to minimize when optimizing the model fit. The options are: "BIC" , "AIC" , or "R_Square". Default is "BIC". |
equalizeRTandPhit |
A boolean that specifies whether the influence of the pHit should be equal to that of rt. Influence is a function of the number of observations. RT has more observations than pHit because it has both correct RTs and incorrect RTs. If this is set to TRUE, then the influence of the pHit and RT is equalized in the minimization statistic. If it is set to FALSE, then the the minimazation statistic is calculated as usual. DEFAULT = FALSE. |
pars.n |
The number of free parameters. When NULL, the program will attempt to calculate the number of free parameters from the input. Default = NULL. |
fileTag |
A string that is appended to the name of files to identify the analysis and experiment. The default is NULL, whereby the filetag will just be based on a timestamp. |
numSimsToAverage |
A number specifying how many simulation runs are in the dataset and should be averaged together to get the final fit. Default is 10. ' |
Several files are saved, including <fileTag>rrwData.txt (which contains the inputData), <fileTag>FitResults.txt (which contains the final parameter fits), <fileTag>Fitted.txt (which contains the input data + simulation fit data). The function returns a list containing (1) a list of the parameter values and fit statistics [runStats], and (2) a dataframe containing the input data with the best fit prediction based on the parameter values [df.fitted].
rrwRunWithFixedParameters(tmp.df, tmpModelList, minN = 40, dataOverlapCol = "overlapRound", RwSamplesCol = "Q50", dataRtCol = "rt", correctCol = "correct01", correctVals = c(1,0), loopsPerRWstep = 200, minimizeStat = 'BIC', equalizeRTandPhit = TRUE, numSimsToAverage = 40, fileTag = NULL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.