Can anyone help me,
I have uploaded a table and want to add another column to it but I want to use the polyfit function as I want 1 column to return back the gradient and 1 column to return back the y-intercept.
I have has to re-add the time points which are constant for all [0.00556 0.0033 0.00138889]
My questions are - can I just use the time points as a variable e.g as "a" or something and how do I calculate the gradient using the 3 measures with against the 3 constant time point?
BodyMass PPO threemin fivemin twelvemin threetime fivetime twelvetime
________ ____ ________ _______ _________ _________ _________ __________
68.08 617 252 233 210 0.0055556 0.0033333 0.00138889
68 939 448 412 386 0.0055556 0.0033333 0.00138889
68.08 620 260 233 200 0.0055556 0.0033333 0.00138889
68 958 453 401 347 0.0055556 0.0033333 0.00138889
83.5 1214 397 362 335 0.0055556 0.0033333 0.00138889
72.5 1039 379 358 335 0.0055556 0.0033333 0.00138889
68 975 451 384 320 0.0055556 0.0033333 0.00138889
84.5 1290 398 353 314 0.0055556 0.0033333 0.00138889
71.42 975 374 333 301 0.0055556 0.0033333 0.00138889
84.5 1278 417 370 319 0.0055556 0.0033333 0.00138889
71.42 981 403 333 278 0.0055556 0.0033333 0.00138889
63.56 970 410 370 316 0.0055556 0.0033333 0.00138889
77 968 460 420 382 0.0055556 0.0033333 0.00138889
84.5 1269 409 369 326 0.0055556 0.0033333 0.00138889
71.42 961 372 343 323 0.0055556 0.0033333 0.00138889
So what I would like is a column that gives the gradient for each row with the x variables of threetime, fivetime and twelvetime (do they have to be part of the table anyway?) and the y variables of threemin fivemin and twelvemin.
Then another column with the y-intercept.
I have tried the following to no scuess
T.CP = polyfit((threetime, fivetime, twelvetime),(threemin, fivemin, twelvemin),1)
T.CP = polyfit([threetime, fivetime, twelvetime],[threemin, fivemin, twelvemin],1)