Posted by
Marta GarcĂa-Granero on
Jul 17, 2006; 8:26am
URL: http://spssx-discussion.165.s1.nabble.com/Levene-Test-for-related-samples-tp1069700p1069702.html
Hi
My two cents:
* Sample dataset: heights (cm) from 11 brother&sister couples *.
DATA LIST FREE/brother sister (2 F8).
BEGIN DATA
180 175 173 163 168 165 170 160 178 165 180 157
178 165 185 163 183 168 165 150 168 157
END DATA.
MATRIX.
GET data /VAR=brother sister /NAMES=vname /MISSING=OMIT.
COMPUTE n=NROW(data).
PRINT n
/FORMAT='F4.0'
/RLABEL='n ='
/TITLE='Sample size'.
COMPUTE mean=CSUM(data)/n.
COMPUTE variance=(CSSQ(data)-n&*(mean&**2))/(n-1).
PRINT {mean;variance}
/FORMAT='F8.2'
/RLABEL='Mean','Variance'
/CNAME=vname
/TITLE='Statistics'.
COMPUTE x=data(:,1).
COMPUTE y=data(:,2).
COMPUTE covxy=((T(x)*y)-n*mean(1)*mean(2))/(n-1).
COMPUTE r=covxy/SQRT(variance(1)*variance(2)).
PRINT {covxy,r}
/FORMAT='F8.3'
/CLABEL='COVxy','r'
/TITLE='Covariance & Pearson r'.
COMPUTE Fratio=MMAX(variance)/MMIN(variance).
COMPUTE tstat=(ABS(Fratio-1)*SQRT(n-2))/(2*SQRT(Fratio*(1-r**2))).
COMPUTE tsig=2*(1-TCDF(ABS(tstat),(n-2))).
PRINT {Fratio,tstat,tsig}
/FORMAT='F8.3'
/CLABEL='F ratio','t value','2-tail p'
/TITLE='Variance ratio & significance'.
END MATRIX.
Marta.
MS> From David Howell's Stat Text.
MS> t = [(F-1)*Sqrt(n-2)]/[(2*Sqrt(F(1-r squared)))].
MS> df for this t is n-2.
MS> F = largest variance divided by the smallest variance
MS> r = correlation between the matched or pair scors.
MS> Check t for sign. If it is not significant than you can safely conclude
MS> that you have met the equal variances assumption for the dependent t
MS> -test.
>>>> Michael Schuler <
[hidden email]> 07/16/06 8:48 AM >>>
MS> I want to compare the variances of two related samples, but i don't
MS> know the statistical test to do this job. In other Words, I'm looking
MS> for a Levene-Test for dependent samples. Could someone tell me the
MS> solution? I couldn't find an answer in my statistic books.