SHAZAM Community
Ask Your Question
0

Excluding observations from the sample (data-file)

asked 2013-09-13 13:43:14 +0000

Pantera gravatar image

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!

edit retag flag offensive close merge delete

Comments

Thank for your help :)

Pantera gravatar imagePantera ( 2013-09-16 05:45:41 +0000 )edit

1 answer

Sort by » oldest newest most voted
1

answered 2013-09-15 16:56:47 +0000

updated 2013-10-03 03:32:59 +0000

Likely 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.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-09-13 13:43:14 +0000

Seen: 785 times

Last updated: Oct 03 '13