[ncl-talk] p-values in reg_multlin_stats not matching R

Peter Gibson peter.gibson at unsw.edu.au
Fri Jul 6 09:29:45 MDT 2018


Hi there,


I am using NCL 6.3.0 and following example 1 (using the same data) from here: https://www.ncl.ucar.edu/Document/Functions/Contributed/reg_multlin_stats.shtml


For some reason my p-value vector is ( 0.1488179, 0.006746806, 0.007730724 ) which differs somewhat from the example 1 result. I have checked against R's multiple linear regression function which matches the NCL example 1 exactly. Is it possible version 6.3.0 from 6.2.0 introduced a bug in the calculation of reg_multin_stats p-values? It seems odd that my stderr and tvals match exactly to the example (and R) just not the p-values.


Thanks,

Peter


--------------------------------


ANOVA outout is as follows:



Number Of Attributes: 31
  _FillValue :    9.96921e+36
  long_name :    multiple regression coefficients
  model :    Yest = b(0) + b(1)*X1 + b(2)*X2 + ...+b(M)*XM
  N :    17
  NP :    2
  M :    3
  bstd :    (  0, 0.5029772, 0.4922954 )
  SST :    13239.72
  SSE :    423.3723
  SSR :    12816.36
  MST :    827.4825
  MSE :    30.24088
  MSE_dof :    14
  MSR :    6408.178
  RSE :    5.499171
  RSE_dof :    13
  F :    211.9045
  F_dof :    ( 2, 14 )
  F_pval :    3.419033e-11
  r2 :    0.9680232
  r :    0.9838817
  r2a :    0.9634551
  fuv :    0.03197682
  Yest :    <ARRAY of 17 elements>
  Yavg :    288.4
  Ystd :    28.766
  Xavg :    ( 55.35294, 30.9 )
  Xstd :    ( 11.68028, 1.172071 )
  stderr :    ( 100.8641, 0.3945341, 3.931675 )
  tval :    ( -1.521964, 3.139713, 3.073079 )
  pval :    ( 0.1488179, 0.006746806, 0.007730724 )
(0)    -153.5115
(1)    1.238724
(2)    12.08235

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180706/105df21d/attachment.html>


More information about the ncl-talk mailing list