SHAZAM Community
Ask Your Question
1

Sequential Anova

asked 2012-07-12 13:55:41 +0000

Jack gravatar image

updated 2012-07-12 16:29:39 +0000

I want to test the mean difference of Variable X between period 1 to 50 against period 51 to 178.(time series has two variables: period and X )

I used the following:

SAMP 1 50
READ (Data.dif) period1   X1  / DIF
SAMP 51 178
READ (Data.dif) period2   X2 / DIF
STAT X1  X2  / ANOVA

Error says:

                               HAS NO OBSERVATIONS IN SAMPLE RANGE

Thanks for your help

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2012-07-12 17:06:32 +0000

updated 2012-07-13 14:56:06 +0000

This should be done by specifying NOREWIND on the READ statement to prevent the file pointer moving to the start of the file on each READ.

An alternative way is to read the 146 rows by 2 columns of data as a matrix and copy the data to the variables you wish. SHAZAM can then perform STAT on the created vectors. Note that the two variables are of different length.

read (data.txt) data / rows=146 cols=2
dim x1 50 1 x2 96 1
copy data x1 / frow=1;50 fcol=2;2 trow=1;50 
copy data x2 / frow=51;146 fcol=2;2 trow=1;96
stat x1  x2  / anova

One helpful tip for creating variables from vectors is to use the GENR command. eg.

genr var_x1=x1
genr var_x2=x2
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2012-07-12 13:55:41 +0000

Seen: 439 times

Last updated: Jul 13 '12