spoD: Determine spontaneous response level or the optimal sample size
Description
The function "spoD" offers two services. In the planning process the number of individuals to test under control conditions is calculated, together with a proposal for partitioning the total data set into subgroups in order to identify the amount of biological variation between experiments. In the analysis process, the spontaneous lethality together with its 95% confidence interval and the biological variation are computed from the users data.
Usage
1 2 3 4 
Arguments
n 
maximally possible number (integer) of test organisms. Limiting this number is necessary to avoid nonessential calculations and thereby save computing time. The program will invite the user to increase the number if the number is not high enough to estimate the SL with the specified precision. 
SL.p 
A rough guess of the spontaneous lethality (SL) in %. It is possible to specify SL.p either as single number or as an interval between 0100% by using SLmin and SLmax. At least SL.p or (SLmin,SLmax) must be specified. 
SLmin 
see SL.p 
SLmax 
see SL.p 
bio.sd.p 
(optional): an assumption about the biological contribution the standard deviation of the estimated SL The default of 2.008% holds for the Fish Embryo Toxicity test. The optimal number of partitions of the sample under control conditions will be determined using the bio.sd.p specified. 
maxCI 
the maximally accepted absolute difference in percent between mean SL and its confidence limits. Default: 2.5%. 
analysis 
defaults to FALSE, indicating that the function does planning. To analyze an SLdataset as described below, choose analysis=TRUE. 
SLdataset 
the data frame containing the spontaneous data to analyze. It has columns titled "n" and "bearer". Column "n" contains the total number of observations, column "bearer" contains the number of organisms which are carriers (in the case of FET the counts of dead or lethal malformed eggs). Each row contains the outcome from one experimental run. 
print.result 
If omitted, the result is written to "01_spontaneous lethality.txt" in the calling directory, if a file name is given, the result is written to that file, if FALSE, nothing is written 
Value
if analyse=FALSE:
targetSL 
assumed spontaneous lethality in %, typically close or
identical to 
ntarget 
total number of organisms to test, based on the point estimate

optnum 
optimal number of separate subtests, based on 
nopt 
number of organisms per subtest, based on 
maxSL 
spontaneous lethality associated with 
Intmin 
lower limit of interval for assumed spontaneous lethality 
Intmax 
upper limit of interval for assumed spontaneous lethality 
maxn 
maximal number of organisms to test, if an interval was given for the assumed spontaneous lethality 
optmax 
optimal number of separate subtests, based on

noptmax 
number of organisms per subtest, based on

with analyse=TRUE:
SL 
estimated spontaneous lethality in % 
CIlo 
lower limit of 95% confidence interval for 
CIup 
upper limit of 95% confidence interval for 
sdSL 
standard deviation of 
Author(s)
Nadia Keddig & Werner Wosniok
References
Optimal test design for binary response data: the example of the Fish Embryo Toxicity Test. Submitted.
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13  #spontaneous lethality
#1a: planning
spoD(n=600,SL.p=3.5,SLmin=NA,SLmax=NA,bio.sd.p=2.008)
spoD(n=600,SL.p=NA,SLmin=3,SLmax=4)
spoD(n=600,SL.p=3.5,SLmin=NA,SLmax=NA,bio.sd.p=2.008,print.result="spoDa.txt")
spoD(n=600,SL.p=3.5,SLmin=NA,SLmax=NA,bio.sd.p=2.008,print.result=FALSE)
#1b: analysis
SLdataset < data.frame(n=rep(60,times=4),bearer=c(1,5,8,3))
spoD(analysis=TRUE,SLdataset=SLdataset)
spoD(analysis=TRUE,SLdataset=SLdataset,print.result="spoDb.txt")
spoD(analysis=TRUE,SLdataset=SLdataset,print.result=FALSE)
