[ncl-talk] missing values in reg_multlin_stats

Anahita Amiri Farahani aamir003 at ucr.edu
Thu Jan 11 11:55:34 MST 2018


I wanted to use reg_multlin_stats to calculate linear regression between
low cloud and stability, the low cloud and stability are my dependent and
independent variables. Stability is calculated based on the potential
temperature at the surface and 700 hPa. So we have missing values for some
areas. When I read the description of this function, it says While missing
values are allowed, it is recommended that users not input any missing
independent values. It just confuses the results. Missing values should be
indicated by the _FillValue
<https://www.ncl.ucar.edu/Document/Language/fillval.shtml> attribute.


But when I use this function I got this error: reg_multlin_stats: XP has
missing values. Not allowed!


Here is my code:


ana=addfile("clouds_E_total.nc","r")
lat=ana->lat
lon=ana->lon
lev=ana->lev
CLDLOW=ana->CLDLOW
CLDMED=ana->CLDMED
CLDHGH=ana->CLDHGH
CLDTOT=ana->CLDTOT
CLOUD=ana->CLOUD
delete(ana)


ana=addfile("stability_E_total.nc","r")
theta_ANN=ana->theta_ANN
theta_summer=ana->theta_summer1
theta_winter=ana->theta_summer1
theta_fall=ana->theta_fall1
theta_spring=ana->theta_spring1
delete(ana)




CLDLOW_1d=ndtooned(CLDLOW)
theta_ANN_1d=ndtooned(theta_ANN)


opt = True
opt at print_anova = True     ; optional
opt at print_data  = True

b   =  reg_multlin_stats(CLDLOW_1d,theta_ANN_1d,opt) ; partial regression
coef


what do you suggest?

Thanks
Ana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180111/4a1fe2f2/attachment.html>


More information about the ncl-talk mailing list