Group Abstract Group Abstract

Message Boards Message Boards

Rearrange a matrix of data to Map LinearModelFit?

5 Replies

You can also get the parameters with this:

Through[lsFunc["BestFitParameters"]]

It is equivalent to Table[[lsFunc[[k]]["BestFitParameters"], {k, 10}].

By the way, you can also construct data like this:

data = Transpose[{ydata, xdata}, {3, 1, 2}];
POSTED BY: Michael Rogers

Michael, how do I apply the Through function if my LinearModelFit results have two levels, like the following, for example?

ols = LinearModelFit[#, v, v] & @@@ # & /@ data

regression results I have tried combinations of Through with Map and others without success.

Thank you

I have found the following way:

#["BestFitParameters"] & /@ # & /@ ols

But I still can't make it work with Through.

Cheers

OK, this worked like a charm:

Table[lsFunc[[j]]["BestFitParameters"], {j, 10}]

Cheers,

Thad

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard