View source: R/floop.repeated.R
| floop.repeated | R Documentation |
Fit a sinusoidal hysteretic process between an input and an output variable across multiple loops separated by subjects and repeated.
floop.repeated(x,y=NULL,m=1,n=1,subjects=NULL,repeated=NULL,
subjects.in="all",repeated.in="all",...)
floop2r.repeated(x,y=NULL,m=1,n=1,subjects=NULL,repeated=NULL,
subjects.in="all",repeated.in="all",...)
## S3 method for class 'fittedlooplist'
summary(object,N=1000,boot=TRUE,seed=NULL,...)
## S3 method for class 'fittedlooplist2r'
summary(object,N=1000,boot=TRUE,seed=NULL,...)
x |
numeric input vector. |
y |
numeric output vector. |
n |
positive integer. Loop shape parameter, see |
m |
positive odd integer. Loop bulging parameter, see |
subjects |
factor of the same length as x that represents experimental units. |
repeated |
factor of the same length as x that represents the repeated measure. |
subjects.in |
a vector of characters, the levels of |
repeated.in |
a vector of characters, the levels of |
object |
an |
N |
number of bootstrap replicates. See |
boot |
whether or not bootstrapping should be performed. See |
seed |
for generating random numbers. See |
... |
extra arguments to either |
Fits multiple loops with one call, separated by the factors subjects and repeated. The arguments subjects.in and repeated.in are used to select subsets of the factors subjects and repeated.
floop.repeated returns an object of class fittedlooplist.
models |
Separate model fits for each loop, see |
Estimates |
Parameter estimates for all loops in matrix form. |
Std.Errors |
Delta standard errors for all loops in matrix form. |
When boot=TRUE floop.repeated returns an object of class loopsummarylist which consists of
models |
Separate model summaries for each ellipse, see |
values |
Bootstrapped parameter estimates, standard errors, quantiles, and more for each loop. |
Boot.Estimates |
Bootstrapped parameter estimates with reduced bias. |
Boot.Std.Errors |
Standard errors provided by bootstrapping. |
Spencer Maynes, Fan Yang, and Anne Parkhurst.
Yang, F. and A. Parkhurst, Efficient Estimation of Elliptical Hysteresis (submitted)
floop and summary.fittedloop, also fel.repeated and summary.ellipsefitlist. Also residuals.fittedlooplist.
data(HysteresisData)
loopmodels.rep <- floop.repeated(HysteresisData$X, HysteresisData$Y,
n=5,m=3, subjects = HysteresisData$subjects,subjects.in=c("A","C"),
repeated=HysteresisData$repeated)
loopmodels.rep #Gives estimates and delta standard errors
loopmodels.rep$Estimates #List estimates only
loopmodels.rep$Std.Errors #List delta standard errors
par(mfrow=c(2,2))
plot(loopmodels.rep,main='Simulated Rep Loops',values="hysteresis")
par(mfrow=c(1,1))
loopmodels.rep$models["A",1] #Select one subject, one replication
### Bootstrap estimates and standard errors (Seed is necessary if want to reproduce results)
boot.rep.loop=floop.repeated(HysteresisData$X, HysteresisData$Y,
n=5,m=3, subjects = HysteresisData$subjects,subjects.in=c("A","C"),
repeated=HysteresisData$repeated,boot=TRUE,seed=123)
boot.rep.loop #Gives boot estimates, boot bias, boot SE and boot quartiles
boot.rep.loop$Boot.Estimates #Lists boot estimates
boot.rep.loop$Boot.Std.Errors #Gives boot standard errors
par(mfrow=c(2,2))
plot(boot.rep.loop, main='Simulated Rep Boot Loops', values="hysteresis")
par(mfrow=c(1,1))
##Can write results to a file. First set your directory from the file tab.
## Change file path in command below to coincide with where you want to store data files
##setwd("C:/Users/..........................")
##write.table(boot.rep.loop$Boot.Estimates,"Hys.eg.repbootvalues.txt")
##test.floop=read.table("Hys.eg.repbootvalues.txt",header=TRUE)
##head(test.floop)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.