Page 1 of 1
Extract interval value
Posted: Thu Mar 27, 2014 10:36 am
by CySam
Hi, I would like to know in writing a programming, how can I extract the value from a given interval. Let's say, from my one-way tabulation of my series of data, interval values are provided in the table, e.g. [-3.2, -3.1). I want to know how can I extract the lower bound value from the interval. As it doesn't consider as a 'value' so in my programming code, =@val(a,b), does not work as it return me the value as 'NA'.
Re: Extract interval value
Posted: Tue Apr 01, 2014 5:20 am
by trubador
I assume you have already saved the output as a table (see freeze command for details if you did not). Suppose the name of the table is mytab and the interval of interest is stored in the 5th row of the 4th column. The following code should do the trick:
Code: Select all
scalar lbound = @val(@mid(mytab(5,4),2,@instr(mytab(5,4),",")-2))
Re: Extract interval value
Posted: Wed Apr 02, 2014 1:53 am
by CySam
Yes, I get the lower bound value from the interval already. Thank you.
By the way, may I know if I want to extract upper bound value what should I change from the code?
Re: Extract interval value
Posted: Wed Apr 02, 2014 2:11 am
by trubador
Code: Select all
scalar ubound = @val(@mid(mytab(5,4),@instr(mytab(5,4),",")+1,@instr(mytab(5,4),")")-@instr(mytab(5,4),",")-1))
Re: Extract interval value
Posted: Sun Apr 20, 2014 8:04 pm
by CySam
Ok noted. Thank you very much.