24小时热门版块排行榜    

查看: 230  |  回复: 8
当前主题已经存档。
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

iangie

木虫 (著名写手)

强气受

[交流] 什么是多线性相关?

就是一个Y跟两个以上的x进行线性相关..
怎么求相关系数啊?

英文叫multiple correlation analyses

» 猜你喜欢

超越性别的爱情才是纯粹的爱情
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

iangie

木虫 (著名写手)

强气受

手上没有数据~~~看到文章里面用了线性相关和多元相关~~~
所以想了解下如何做多元回归....

你说Excel都可以做吗?
偶去搜搜看...
超越性别的爱情才是纯粹的爱情
5楼2010-03-12 11:12:08
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 9 个回答

Daoist

木虫 (正式写手)

iangie(金币+5):谢谢~~只会excel... 2010-03-12 11:46
用EXCEL 分析工具 /相关工具可求,非常简单
也可以用SPSS求,也很简单
2楼2010-03-12 11:03:35
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

Daoist

木虫 (正式写手)

再不见数据我就走了
4楼2010-03-12 11:05:37
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

iangie

木虫 (著名写手)

强气受

Excel 果然可以~~帮助中搜索multiple regression找到的结果...贴出来方便后人...


Excel > Function reference > Statistical
LINEST function
Show All
Hide All
This article describes the formula syntax and usage of the LINEST function (function: A prewritten formula that takes a value or values, performs an operation, and returns a value or values. Use functions to simplify and shorten formulas on a worksheet, especially those that perform lengthy or complex calculations.) in Microsoft Office Excel. Find links to more information about charting and performing a regression analysis in the See Also section.

Description
The LINEST function calculates the statistics for a line by using the "least squares" method to calculate a straight line that best fits your data, and then returns an array that describes the line. You can also combine LINEST with other functions to calculate the statistics for other types of models that are linear in the unknown parameters, including polynomial, logarithmic, exponential, and power series. Because this function returns an array of values, it must be entered as an array formula. Instructions follow the examples in this article.

The equation for the line is:

y = mx + b

–or–

y = m1x1 + m2x2 + ... + b (if there are multiple ranges of x-values)

where the dependent y-values are a function of the independent x-values. The m-values are coefficients corresponding to each x-value, and b is a constant value. Note that y, x, and m can be vectors. The array that the LINEST function returns is {mn,mn-1,...,m1,b}. LINEST can also return additional regression statistics.

Syntax
LINEST(known_y's, [known_x's], [const], [stats])The LINEST function syntax has the following arguments (argument: A value that provides information to an action, an event, a method, a property, a function, or a procedure.):

known_y's  Required. The set of y-values that you already know in the relationship y = mx + b.
If the range of known_y's is in a single column, each column of known_x's is interpreted as a separate variable.

If the range of known_y's is contained in a single row, each row of known_x's is interpreted as a separate variable.
known_x's  Optional. A set of x-values that you may already know in the relationship y = mx + b.
The range of known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).

If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.
const  Optional. A logical value specifying whether to force the constant b to equal 0.
If const is TRUE or omitted, b is calculated normally.

If const is FALSE, b is set equal to 0 and the m-values are adjusted to fit y = mx.
stats  Optional. A logical value specifying whether to return additional regression statistics.
If stats is TRUE, LINEST returns the additional regression statistics; as a result, the returned array is {mn,mn-1,...,m1,b;sen,sen-1,...,se1,seb;r2,sey;F,df;ssreg,ssresid}.

If stats is FALSE or omitted, LINEST returns only the m-coefficients and the constant b.
The additional regression statistics are as follows.

Statistic Description
se1,se2,...,sen The standard error values for the coefficients m1,m2,...,mn.
seb The standard error value for the constant b (seb = #N/A when const is FALSE).
r2 The coefficient of determination. Compares estimated and actual y-values, and ranges in value from 0 to 1. If it is 1, there is a perfect correlation in the sample — there is no difference between the estimated y-value and the actual y-value. At the other extreme, if the coefficient of determination is 0, the regression equation is not helpful in predicting a y-value. For information about how r2 is calculated, see "Remarks," later in this topic.
sey The standard error for the y estimate.
F The F statistic, or the F-observed value. Use the F statistic to determine whether the observed relationship between the dependent and independent variables occurs by chance.
df The degrees of freedom. Use the degrees of freedom to help you find F-critical values in a statistical table. Compare the values you find in the table to the F statistic returned by LINEST to determine a confidence level for the model. For information about how df is calculated, see "Remarks," later in this topic. Example 4 shows use of F and df.
ssreg The regression sum of squares.
ssresid The residual sum of squares. For information about how ssreg and ssresid are calculated, see "Remarks," later in this topic.

The following illustration shows the order in which the additional regression statistics are returned.



Remarks
You can describe any straight line with the slope and the y-intercept:
Slope (m):
To find the slope of a line, often written as m, take two points on the line, (x1,y1) and (x2,y2); the slope is equal to (y2 - y1)/(x2 - x1).

Y-intercept (b):
The y-intercept of a line, often written as b, is the value of y at the point where the line crosses the y-axis.

The equation of a straight line is y = mx + b. Once you know the values of m and b, you can calculate any point on the line by plugging the y- or x-value into that equation. You can also use the TREND function.

When you have only one independent x-variable, you can obtain the slope and y-intercept values directly by using the following formulas:
Slope:
=INDEX(LINEST(known_y's,known_x's),1)

Y-intercept:
=INDEX(LINEST(known_y's,known_x's),2)

The accuracy of the line calculated by the LINEST function depends on the degree of scatter in your data. The more linear the data, the more accurate the LINEST model. LINEST uses the method of least squares for determining the best fit for the data. When you have only one independent x-variable, the calculations for m and b are based on the following formulas:




where x and y are sample means; that is, x = AVERAGE(known x's) and y = AVERAGE(known_y's).

The line- and curve-fitting functions LINEST and LOGEST can calculate the best straight line or exponential curve that fits your data. However, you have to decide which of the two results best fits your data. You can calculate TREND(known_y's,known_x's) for a straight line, or GROWTH(known_y's, known_x's) for an exponential curve. These functions, without the new_x's argument, return an array of y-values predicted along that line or curve at your actual data points. You can then compare the predicted values with the actual values. You may want to chart them both for a visual comparison.
In regression analysis, Excel calculates for each point the squared difference between the y-value estimated for that point and its actual y-value. The sum of these squared differences is called the residual sum of squares, ssresid. Excel then calculates the total sum of squares, sstotal. When the const argument = TRUE or is omitted, the total sum of squares is the sum of the squared differences between the actual y-values and the average of the y-values. When the const argument = FALSE, the total sum of squares is the sum of the squares of the actual y-values (without subtracting the average y-value from each individual y-value). Then regression sum of squares, ssreg, can be found from: ssreg = sstotal - ssresid. The smaller the residual sum of squares is, compared with the total sum of squares, the larger the value of the coefficient of determination, r2, which is an indicator of how well the equation resulting from the regression analysis explains the relationship among the variables. The value of r2 equals ssreg/sstotal.
In some cases, one or more of the X columns (assume that Y’s and X’s are in columns) may have no additional predictive value in the presence of the other X columns. In other words, eliminating one or more X columns might lead to predicted Y values that are equally accurate. In that case these redundant X columns should be omitted from the regression model. This phenomenon is called “collinearity” because any redundant X column can be expressed as a sum of multiples of the non-redundant X columns. The LINEST function checks for collinearity and removes any redundant X columns from the regression model when it identifies them. Removed X columns can be recognized in LINEST output as having 0 coefficients in addition to 0 se values. If one or more columns are removed as redundant, df is affected because df depends on the number of X columns actually used for predictive purposes. For details on the computation of df, see Example 4. If df is changed because redundant X columns are removed, values of sey and F are also affected. Collinearity should be relatively rare in practice. However, one case where it is more likely to arise is when some X columns contain only 0 and 1 values as indicators of whether a subject in an experiment is or is not a member of a particular group. If const = TRUE or is omitted, the LINEST function effectively inserts an additional X column of all 1 values to model the intercept. If you have a column with a 1 for each subject if male, or 0 if not, and you also have a column with a 1 for each subject if female, or 0 if not, this latter column is redundant because entries in it can be obtained from subtracting the entry in the “male indicator” column from the entry in the additional column of all 1 values added by the LINEST function.
The value of df is calculated as follows, when no X columns are removed from the model due to collinearity: if there are k columns of known_x’s and const = TRUE or is omitted, df = n – k – 1. If const = FALSE, df = n - k. In both cases, each X column that was removed due to collinearity increases the value of df by 1.
Formulas that return arrays must be entered as array formulas.
When entering an array constant (such as known_x's) as an argument, use commas to separate values that are contained in the same row and semicolons to separate rows. Separator characters may differ, depending on your locale setting in Regional and Language Options in Control Panel.
Note that the y-values predicted by the regression equation may not be valid if they are outside the range of the y-values you used to determine the equation.
The underlying algorithm used in the LINEST function is different than the underlying algorithm used in the SLOPE and INTERCEPT functions. The difference between these algorithms can lead to different results when data is undetermined and collinear. For example, if the data points of the known_y's argument are 0 and the data points of the known_x's argument are 1:
LINEST returns a value of 0. The algorithm of the LINEST function is designed to return reasonable results for collinear data and, in this case, at least one answer can be found.
SLOPE and INTERCEPT return a #DIV/0! error. The algorithm of the SLOPE and INTERCEPT functions is designed to look for only one answer, and in this case there can be more than one answer.
In addition to using LOGEST to calculate statistics for other regression types, you can use LINEST to calculate a range of other regression types by entering functions of the x and y variables as the x and y series for LINEST. For example, the following formula:
=LINEST(yvalues, xvalues^COLUMN($A:$C))

works when you have a single column of y-values and a single column of x-values to calculate the cubic (polynomial of order 3) approximation of the form:

y = m1*x + m2*x^2 + m3*x^3 + b

You can adjust this formula to calculate other types of regression, but in some cases it requires the adjustment of the output values and other statistics.
Example 1
Slope and Y-Intercept

The example may be easier to understand if you copy it to a blank worksheet.

How do I copy an example?

Select the example in this article.
Important  Do not select the row or column headers.



Selecting an example from Help

Press CTRL+C.
In Excel, create a blank workbook or worksheet.
In the worksheet, select cell A1, and press CTRL+V.
Important  For the example to work properly, you must paste it into cell A1 of the worksheet.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
After you copy the example to a blank worksheet, you can adapt it to suit your needs.


--------------------------------------------------------------------------------

   
1
2
3
4
5
6
7
A B C
Known y Known x  
1 0  
9 4  
5 2  
7 3  
Formula Formula Result
=LINEST(A2:A5,B2:B5,,FALSE)  A7=2, B7=1


Important  The formula in the example must be entered as an array formula. After copying the example to a blank worksheet, select the range A7:B7, starting with the formula cell. Press F2, and then press CTRL+SHIFT+ENTER. If the formula is not entered as an array formula, the single result is 2.

When entered as an array, the slope (2) and the y-intercept (1) are returned.

[ Last edited by iangie on 2010-3-12 at 12:08 ]
超越性别的爱情才是纯粹的爱情
6楼2010-03-12 11:45:59
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通表情 高级回复 (可上传附件)
信息提示
请填处理意见