SHAZAM Questions and Answers (Q&A) - RSS feedhttp://community.econometrics.com/questions/SHAZAM Econometrics, Statistics and Analytics Communityen<font color="white">Copyright <b>SHAZAM Analytics, 2018</b></font>Thu, 12 Jul 2012 17:06:32 +0000Sequential Anovahttp://community.econometrics.com/question/238/sequential-anova/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
Thu, 12 Jul 2012 13:55:41 +0000http://community.econometrics.com/question/238/sequential-anova/Answer by SHAZAMHelp for <p>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 )</p>
<p>I used the following: </p>
<pre><code>SAMP 1 50
READ (Data.dif) period1 X1 / DIF
SAMP 51 178
READ (Data.dif) period2 X2 / DIF
STAT X1 X2 / ANOVA
</code></pre>
<p>Error says:</p>
<pre><code> HAS NO OBSERVATIONS IN SAMPLE RANGE
</code></pre>
<p>Thanks for your help</p>
http://community.econometrics.com/question/238/sequential-anova/?answer=325#post-id-325This 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
Thu, 12 Jul 2012 17:06:32 +0000http://community.econometrics.com/question/238/sequential-anova/?answer=325#post-id-325