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>Mon, 16 Sep 2013 05:45:41 +0000Excluding observations from the sample (data-file)http://community.econometrics.com/question/383/excluding-observations-from-the-sample-data-file/**Hi all**,
I’m running a regression analysis. Unfortunately, I recognized that some of the observations are associated with errors, and I want to exclude these observations from the regression. The criterion I want to use in an exclusion of observations is that the sum of three of the variables in the sample is zero, i.e.: I want to exclude observations from the regression which fulfills the criterion; x1 + x2 + x3 = 0. I do **NOT** want to exclude variables, only observations which fulfill the criterion. Question: Is it possible to use a Shazam-code to solve the problem. I looked into the SKIPIF-command but couldn’t find a way out of it.
Best regards!
Fri, 13 Sep 2013 13:43:14 +0000http://community.econometrics.com/question/383/excluding-observations-from-the-sample-data-file/Comment by Pantera for <p><strong>Hi all</strong>,
I’m running a regression analysis. Unfortunately, I recognized that some of the observations are associated with errors, and I want to exclude these observations from the regression. The criterion I want to use in an exclusion of observations is that the sum of three of the variables in the sample is zero, i.e.: I want to exclude observations from the regression which fulfills the criterion; x1 + x2 + x3 = 0. I do <strong>NOT</strong> want to exclude variables, only observations which fulfill the criterion. Question: Is it possible to use a Shazam-code to solve the problem. I looked into the SKIPIF-command but couldn’t find a way out of it.</p>
<p>Best regards! </p>
http://community.econometrics.com/question/383/excluding-observations-from-the-sample-data-file/?comment=386#post-id-386Thank for your help :)Mon, 16 Sep 2013 05:45:41 +0000http://community.econometrics.com/question/383/excluding-observations-from-the-sample-data-file/?comment=386#post-id-386Answer by SHAZAMHelp for <p><strong>Hi all</strong>,
I’m running a regression analysis. Unfortunately, I recognized that some of the observations are associated with errors, and I want to exclude these observations from the regression. The criterion I want to use in an exclusion of observations is that the sum of three of the variables in the sample is zero, i.e.: I want to exclude observations from the regression which fulfills the criterion; x1 + x2 + x3 = 0. I do <strong>NOT</strong> want to exclude variables, only observations which fulfill the criterion. Question: Is it possible to use a Shazam-code to solve the problem. I looked into the SKIPIF-command but couldn’t find a way out of it.</p>
<p>Best regards! </p>
http://community.econometrics.com/question/383/excluding-observations-from-the-sample-data-file/?answer=384#post-id-384Likely this is because the SET SKIP command was not used before using the SKIPIF command. This is required to switch on SKIPIF usage.
After that you can then use SKIPIF(expression) where expression may use arithmetic or logical operators such as those described for the GENR and IF commands.
Examples include:
skipif (x3+x4.eq.x5)
skipif (x3.gt.x12)
skipif ((x4.eq.0).or.(x5.eq.0))
skipif (time(0).eq.6)
skipif (x1)
skipif (lag(x2+3)/12-x4)
skipif (province.eq."manitoba")
skipif (abs(x3+x4-x5).le.0.0001)
Further details can be found in the chapters on Generating Variables and Set and Display.
Sun, 15 Sep 2013 16:56:47 +0000http://community.econometrics.com/question/383/excluding-observations-from-the-sample-data-file/?answer=384#post-id-384