MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re:multiple linear regression


Jeff D. Hamann wrote:

>I can't figure out how to do multiple linear regreesion from dat that is
>read in from a file.....


>for example


>data=ReadList["h:\st552\hw4\watershd.dta", Number, RecordLists->True]

>where the file has ten columns of data and i want to fit columns 2,3,
>and 6 on column 7.

>and performing 3-d list plots?

Jeff,
First,load Statistics` and Graphics`. Choose the columns you want to
use:

reducedData=Transpose[Extract[Transpose[data],{{2},{3},{6},{7}}]]

and then run the regression, e.g.,

Regress[reducedData,{1,x,y,z},{x,y,z}]

You may plot any two of the independent variables together with the
response variable using ScatterPlot3D or ListSurfacePlot3D from the
Graphics` AddOn.

Good luck,

Tomas Garza
Mexico City



  • Prev by Date: Re: Character problem
  • Next by Date: Re: accessing large files
  • Previous by thread: Re: multiple linear regression
  • Next by thread: Points on MultipleListPlots