Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

Re:multiple linear regression

  • To: mathgroup at smc.vnet.net
  • Subject: [mg15843] Re:[mg15751] multiple linear regression
  • From: "Tomas Garza" <tgarza at mail.internet.com.mx>
  • Date: Fri, 12 Feb 1999 18:40:03 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

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