Description Usage Arguments Details Value See Also Examples
A function to fit curve to d primes obtained from MR-SAT experiment.
1 2 3 4 5 6 |
data |
data frame contining columns named |
par.cond |
a list specifying the configuraiton of parameters per condition. Should contain three named elements: |
fix.asym |
a logical specifying whether asymptote parameters of the model should be fixed to the starting values supplied in the |
params |
a data frame specifying parameters, containing columns named |
opt |
charaster or a character vector indication the optimizer to be used. If |
multi.opt |
logical, specifying wheather to fit the data using multiple optimizer. |
rep |
numeric, representing number of times the optimazation process is repeated. If |
quiet |
logical. Default to |
maxit |
The maximun number of iteration. Defaults to |
strict |
logical. Only relevant if |
trace |
logical. Only relevant if |
The argument par.cond
specifies whether or not and how certain parameter(s) are shared across conditions (which are specified in condition
column of data
). The argument par.cond
can take either list or matrix, as long as it meets following specification. If it is a list, then it should be a named list containing following elements: asym
, rate
, and incp
. Each element of the list must be of same length, being equal either to length(condition)
or to length(levels(condition))
(or length(unique(condition))
if condition
is not a factor). If it is a matrix, then it should have asym
, rate
, and incp
as its columns, and rows should represent different condiitons.
As an example, there are three elements in par
(i.e., length(par) = 3
), and there are three conditions so that the three conditions share all of λ (asymptote), β (rate) and δ (intercept). In this case, par.cond
should be specified as list(asym=c(1,1,1), rate=c(1,1,1), incp=c(1,1,1))
.
As another example, there are six elements in par
, consisting of three λ (asymptote; one for each condition) , two β (rate; one for condition 1 and anothor for condition 2 and 3), and one δ (intercept; for all the conditions). Here, par.cond = list(asym=c(1,2,3), rate=c(1,2,2), incp=c(1,1,1))
fit |
a list of object returned from the optimizer (if multiple optimizers were used, the one that returned the smallest RMSE), with a few additinal information |
SSE |
Sum of Squared Error of the model. |
MSE |
Mean Squared Error of the model. A object of class |
RMSE |
Root Mean Squared Error of the model. |
logLik |
Log likelihood of the model. A object of class |
R2 |
R squared of the model |
adjR2 |
adjusted R squared of the model |
data |
same as the argument |
par.cond |
same as the argument |
rep.out |
If |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #load data
data(Auditory_demo)
#need to define the scale.list
exp1.signal <- list(noint = c(1,3),
obrel = c(5,8),
obrelsub = c(11, 14))
exp1.noise <- list(noint = c(2,4),
obrel = c(6, 7, 9, 10),
obrelsub = c(12, 13, 15, 16))
# tag bins
s01.bins <- get.bins(Auditory_demo, auditory=TRUE, window = "fixed")
#calculate dprimes
s01.dp<- get.dprime(s01.bins$bins,
signal.list = exp1.signal, noise.list = exp1.noise, is.index = TRUE,
binmax=14)
# specify par.cond
my.pc <- list(asym=c(1,2,3), rate=c(1,2,2), incp=c(1,1,1))
# fit the data
s01.fit <- fit.SATcurve(s01.dp, par.cond = my.pc)
#plot the data and fitter curves
plot(s01.fit)
#to calculate AIC and BIC, do
AIC(s01.fit)
BIC(s01.fit)
#you may also calculate AIC analogue using MSE
# as suggested by Burnham and Anderson (1998)
AIC(s01.fit$MSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.