Aptech Systems, Inc. Worldwide Headquarters
Aptech Systems, Inc.
2350 East Germann Road, Suite #21
Chandler, AZ 85286
Ready to Get Started?
For Pricing and Distribution
Training & Events
Step-by-step, informative lessons for those who want to dive into GAUSS and achieve their goals, fast.
Have a Specific Question?
Q&A: Register and Login
Premier Support and Platinum Premier Support are annually renewable membership programs that provide you with important benefits including technical support, product maintenance, and substantial cost-saving features for your GAUSS System or the GAUSS Engine.
Join our community to see why our users are considered some of the most active and helpful in the industry!
Where to Buy
Available across the globe, you can have access to GAUSS no matter where you are.
Recent Tagsapplications character vectors CMLMT Constrained Optimization covariance matrix datasets dates dlibrary dllcall error error codes errors Excel FANPACMT file i/o floating network GAUSS Engine graphics GUI hotkeys installation Java API license licensing linux loading data loops matrices matrix manipulation Maxlik MLMT operators OPMT optimization Optmum PQG graphics procs random numbers simgauss string functions strings structures threading Time Series writing data
Time Series 2.0 MT
Find out more now
Time Series MT 2.1
Handling non-numbers when reading data from Excel
I would like to compute a simple ratio from two datasets:
(pb - pa) / 2
I have some missing values in each series that are non-values. I would
like to not compute this ratio when pb or pa have “no value”
The series are loaded from xlsx, and I use the following command:
vls = reshape(error(0),9,1); vls =9999.99; /* To convert all occurrences of #DIV/0! to 9999.99, and all other empty cells and special types to GAUSS missing values */ pa = xlsreadm("C:\\Gauss8.0\\myfiles\\german_pa.xlsx","b1",1,vls); pb = xlsreadm("C:\\Gauss8.0\\myfiles\\german_pb.xlsx","b1",1,vls);
But applying this synthax is not good, it compute the ratio because the
9999.99 is obviously a value… I do not find the good synthax
Somebody can help me?
I believe that if you do not explicitly set the <tt>vls</tt> parameter, all instances of DIV/0, Nan, missing values etc will be converted to a GAUSS missing value. Pass in an empty string for vls
vls = ""; pa = xlsreadm("C:\\Gauss8.0\\myfiles\\german_pa.xlsx","b1",1,vls); pb = xlsreadm("C:\\Gauss8.0\\myfiles\\german_pb.xlsx","b1",1,vls);
Then the elements with missing values will not compute the ratio, for example if after loading from your Excel sheet:
pa = 10 5 . 8 3 pb = 2 3 9 . 1
Then (pa - pb)/2 =:
4 1 . . 1
If you want to remove the rows with missing values, you can use the packr function.