[gradsusr] Linear regression

David Nielsen davidnielsen at id.uff.br
Fri Apr 1 17:41:11 EDT 2016


Hi, Ana,

Once you already have the values for a and b in y=ax+b, being time your x,
I imagine you could use the time variable of you file and do something like:

'a=(your a value here)'
'b=(your b value here)'
while (count < number)
'set t ' count
   'y=a*t + b'
   y=subwrd(result,4)
   rc = write ("path\file.txt",y)
   count=count+1
endwhile

Then you will have a txt with a y value for each t in one column. Is this
what you need?

Best,

On Wed, Mar 30, 2016 at 1:02 PM, Ana Tobón <ana.tobon at outlook.com> wrote:

> Hello,
>
>
> I'm relatively new in GrADS and I have a question. I have a NetCDF file
> and with a grads script I could calculate the intercept and the slope of a
> linear regression model. Now I need to construct the fitted model (y=a+bx)
> based on the slope and intercept I calculated before being the time the
> independent variable, how can I create a time variable or how can I
> construct the fitted model? This way I would have the fitted model and I
> could calculate the residuals which is what I need.
>
>
> Thanks in advance,
>
> Ana.
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20160401/58a07ff3/attachment.html 


More information about the gradsusr mailing list