Hi,
I performed a multiple linear regression analysis using NCL function "reg_multlin" to obtain a 2D (lat,lon) map of standardized regression coefficients (6 independent variables, 30 observations).
N = dimsizes(y)
M = N_vars
X = new( (/M+1,N/), "float" )
X(0,:) = 1.0
X(1,:) = x1
X(2,:) = x2
X(3,:) = x3
X(4,:) = x4
X(5,:) = x5
X(6,:) = x6
beta = reg_multlin(y, X, False)
Now, I would like to compute the p-value that is associated to each regression coefficient.
I'm thinking about, firstly, computing the t-value by doing the ratio between a regression coefficient and its standard deviation, afterwards I will use the NCL function "betainc" to get the p-value for a Student t-test.
My problem is that I don't know how to obtain the standard deviation of each regression coefficient using NCL. I tried to move the "reg_multlin" function in a loop over the number of observations:
do nf = 0,nfils-1,1
-> b_nf(:,nf) = reg_multlin(y, X(:,nf), False)
end do
fAODbeta(ns,ilat,ilon) = beta(1) + 0.
fAODbeta_std(ns,ilat,ilon) = stddev(b_nf(1,:)) + 0.
but I get the following error for the line indicated by an arrow (->)
fatal:Number of dimensions in parameter (1) of (reg_multlin) is (1), (2) dimensions were expected
Could you suggest me how to solve my problem?
Or do you know a better way to estimate the p-value associated with each regression coefficients?
Many thanks!
Best regards,
Susanna
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jan 8 14:26:32 2014
This archive was generated by hypermail 2.1.8 : Sun Jan 19 2014 - 21:56:35 MST