Ttest2e and Vline: Difference between pages

From Eigenvector Research Documentation Wiki
(Difference between pages)
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
 
imported>Scott
 
Line 1: Line 1:
===Purpose===
===Purpose===


Two sample t-test (assuming equal variance).
Place a vertical line in an existing figure.


===Synopsis===
===Synopsis===


:result = ttest2e(x,y,''test'')
:h = vline(''x,lc'')


===Description===
===Description===


Calculates a two sample t-test for samples (x) and (y) assuming equal variance.
VLINE draws a vertical line on an existing figure from the bottom axis to the top axis at at postions defined by <tt>x</tt> which can be a scalar or vector. If no input is used for ''<tt>x</tt>'' the default value is zero {default x = 0}.
 
====INPUTS====
 
* '''x''' = matrix (column vector) in which the sample data is stored.
 
* '''y''' = matrix (column vector) in which the sample data is stored.
 
* '''ttest''' = [-1,{0},1] indicates what ttest is for:
 
'''-1''' - lower tail  H0: mean(x) <= mean(y)
 
*    '''0''' - wo-tail    H0: mean(x) \~= mean(y) {default}
 
*    '''1''' - upper tail  H0: mean(x) >= mean(y)
 
====OUTPUTS====
 
The output (result) a structure with the following fields:
 
* '''t''' = test statistic.
 
* '''p''' = probability value
 
* '''mean1''' = mean of x
 
* '''mean2''' = mean of y
 
* '''var1''' = variance of x
 
* '''var2''' = variance of y
 
* '''n1''' =  length of x
 
* '''n2''' =  length of y
 
* '''pse''' = pooled standard error


* '''df''' = degress of freedom
Optional input ''<tt>lc</tt>'' is used to define the line style and color as in normal plotting (see MATLAB PLOT command). If no inputs are supplied, VLINE draws a vertical green line at 0.


* '''hyp''' =  hypothesis being tested
Output <tt>h</tt> is the handle(s) of line(s) drawn.


===Examples===
===Examples===


result = ttest2e(x,y);
vline([2.5 3],'-r')


result = ttest2e(x,y,test);
plots a vertical red line at x = 2.5 and 3.


===See Also===
===See Also===


[[ttest1]], [[ttest2u]], [[ttest2p]]
[[abline]], [[dp]], [[ellps]], [[hline]], [[plttern]], [[pltternf]], [[zline]]

Latest revision as of 16:30, 21 September 2011

Purpose

Place a vertical line in an existing figure.

Synopsis

h = vline(x,lc)

Description

VLINE draws a vertical line on an existing figure from the bottom axis to the top axis at at postions defined by x which can be a scalar or vector. If no input is used for x the default value is zero {default x = 0}.

Optional input lc is used to define the line style and color as in normal plotting (see MATLAB PLOT command). If no inputs are supplied, VLINE draws a vertical green line at 0.

Output h is the handle(s) of line(s) drawn.

Examples

vline([2.5 3],'-r')

plots a vertical red line at x = 2.5 and 3.

See Also

abline, dp, ellps, hline, plttern, pltternf, zline