probit_analysis is the user-defined function from the file /home/rafael/octave/probit/probit_analysis.m - Function File: [THRESHOLD, SLOPE, CHISQUARE_FITTING, DOF_FITTING, PVALUE_FITTING, THRESHOLD_INDEP, SLOPE_INDEP, CHISQUARE_PARALLEL, DOF_PARALLEL, PVALUE_PARALLEL, T_THRESHOLD, PVALUE_THRESHOLD] = probit_analysis (CONTROL_VAR, BATCH_SIZE, SUCCESS_COUNT) Do a probit analysis of quantal response data as presented by Finney[1]. The data is grouped according to different conditions and cumulative normal curves are fitted for each conditions. The slopes of the curves at P = 0.5 are forced to be the same accross all the conditions. The following statistical tests are executed: 1. Goodness of fit (chi square test) 2. Parallelism of the fitted curves (chi square test) 3. Separation of parallel curves at P = 0.5 (Student t test) The data is provided in the three input arguments CONTROL_VAR, BATCH_SIZE, and SUCCESS_COUNT. These arguments must be cell variables with the same length, with the elements `CONTROL_VAR{i}', `BATCH_SIZE{i}', and `SUCCESS_COUNT{i}' representing the data for condition `i'. These elements for condition `i' must be vectors of the same length whose meanings are: `CONTROL_VAR{i}' The controlled variable of the experiment. This is usually shown as the horizontal axis in plots. Notice that in some cases it may be better to work with the logarithm of the controlled variables, in particular for case where the underlying sensitivity function is asymetric (see [1]). The needed transformations on CONTROL_VAR are let to the user. `BATCH_SIZE{i}' The size of the batch in number of individuals or trials. `SUCCESS_COUNT{i}' The number of individuals or trials that responded positively in the experiment under condition `i'. The meaning of the output arguments are as follows: `THRESHOLD' Vector with the same length as CONTROL_VAR containing the fitted thresholds for each condition, assuming the parallelism hypothesis (null hypothesis). A threshold is the value of the controlled variable for which the fitted curve gives P = 0.5. `SLOPE' Scalar with the fitted common slope for all conditions. `CHISQUARE_FITTING' Chi square value for use in the goodness of fit test. Large values of CHISQUARE_FITTING suggest rejection of the probit regression fit. `DOF_FITTING' Number of degrees of freedom for the goodness of fit test. `PVALUE_FITTING' p-value for the goodness of fit test. `THRESHOLD_INDEP' Same as THRESHOLD, but for each condition being fitted separately. `SLOPE_INDEP' Vector containing the slopes for the curves fitted individually for each condition. `CHISQUARE_PARALLEL' Chi square value for the parallel component of the model. It is computed as the difference between the chi square value for the parallel fitting minus the total chi square for the individual fittings. This is a valid procedure because the two models considered are nested. A large value of CHISQUARE_PARALLEL indicates that the null hypothesis (i,e. the parallelism of the curves) can be rejected. `DOF_PARALLEL' Number of degrees of freedom for the parallelism test. `PVALUE_PARALLEL' p-value of the parallelism component of the model. `T_THRESHOLD' A matrix containing the Student-t values for the fiducial intervals. These values are computed for each two-by-two combinations of the experimental conditions. `T_THRESHOLD(i,j)' is the t value for the fiducial interval of the difference in the thresholds in conditions `i' and `j' being equal to zero. `PVALUE_THRESHOLD' p-value for the Student-t values in T_THRESHOLD. CAVEAT: When heterogeneity is present in the data, which arises from small batch sizes or from correlations among individual responses (see [1], section 4.6, page 71), the chi square statistics are inflated and must be corrected. This is not done in the current implementation of this function. Also, when either the goodness of fit or the parallelism null hypothesis can be rejected, the t test of difference in thresholds is meaningless. [1] Finney, D.J. (1971) "Probit Analysis", Cambridge University Press, 3rd ed. See also: probit_likelihood_function, probit_finney_examples.m.