Access Standardized Residuals and Count
Posted: Tue Feb 21, 2017 4:58 am
Given a equation object eq_01, I want to create a 1 line code that counts a property of the equation object that can be run from the command line.
Specifically I'm trying to write a scalar comprehension: the percentage representation of how many standardized residuals have an absolute value greater than 2
Currently I'm using the following to access the standardized residuals:
eq_01.makeresid(s) res_std
I have two questions:
1. Is there any way to access the standardized residuals using the existing eq_01 object only? In other words not needing to create a new res_std object?
2. Is there a way to do a count if type of operation from the command line? I only know of @recode() which, if I'm not mistaken also would output an additional series object of 1's and 0's.
For clarity let me provide my pseudo code:
It's rather simple, but the only solutions I have seen so far is using an actual program. I'm apprehensive about having to write, save, and then at a later time load a program, every time I need perform a simple calculation.
Specifically I'm trying to write a scalar comprehension: the percentage representation of how many standardized residuals have an absolute value greater than 2
Currently I'm using the following to access the standardized residuals:
eq_01.makeresid(s) res_std
I have two questions:
1. Is there any way to access the standardized residuals using the existing eq_01 object only? In other words not needing to create a new res_std object?
2. Is there a way to do a count if type of operation from the command line? I only know of @recode() which, if I'm not mistaken also would output an additional series object of 1's and 0's.
For clarity let me provide my pseudo code:
Code: Select all
scalar my_scalar = percentage of standardized residuals of eq_01 having @abs() greater than or equal to 2.