Sunteți pe pagina 1din 14

MasterMSS20112012

Metode de analiza si prognoza pentru managementul sanitar

Analiza de regresie 1 i de corelaie


Efectuarea de prognoze economice privind valorile variabilei endogene Y n funcie de diferitele valori exogene X presupune acceptarea ipotezei c legitatea de dependen dintre Y i X este corect specificat i identificat, avnd un caracter de relativ stabilitate i repetabilitate. Primul scop al analizei de regresie este de arta cum este legat o variabil de una sau mai multe variabile Y cu ajutorul unei ecuaii care d posibilitatea de a previziona variabilele dependente n funcie de valorile cunoscute ale variabilelor independente X (x1, x2, , xn). In general, prin analiza de regresie se face o comparaie statistic a relatiilor anterioare ntre diferii factori. Dependena statistic este o dependen care se manifest nu ntre elemente i fenomene individuale, ci ntre colectiviti de fenomene. Msurile de asociere elaborate de statistica matematic permit depistarea i ierarhizarea dependenelor statistice, care se manifest ntre fenomenele i procesele istorice. Msurile de asociere statistic deschid astfel posibilitatea descoperirii legitilor statistice specifice acelor relaii de condiionare dintre fenomenele i procesele istorice, care prezint caracteristici statistice cuatificabile. Tabelul 1. Analiza de regresie i analiza de corelaie
Prin analiza regresiei se nelege o clas de metode prin care, folosind o ecuaie de regresie determinat pe baza unor date experimentale, pot fi estimate (previzionate) valorile unor variabile date, presupunnd cunoscute ori previzionate valorile altor variabile. Analiza corelaiei are ca obiectiv evaluarea gradului de interdependen (asociere) ntre variabilele considerate ntrun model de regresie, n particular ntre variabila dependent i cele independente (obiectiv care se realizeaz prin estimarea coeficienilor de corelaie i a coeficientului de determinare).

Natura stochastic a modelului de regresie face ca valoarea lui Y s nu poat fi prevzut exact, incertitudinea aprnd ca rezultat la mrimea aleatoare e (eroarea). Distribuia probabilistic a lui Y i caracteristicile sale sunt determinate de valorile lui e i de distribuia sa probabilistic. Ipotezele de aplicare ale metodelor de regresie sunt: - variabilele Y i X nu sunt afectate de erori de msurare. Legitatea de dependen a lui yi este condiionat de realizarea valorilor x1,x2, , xn ale variabilei exogene X; - variabila aleatoare (rezidual) este de medie 0, iar dispersia ei este independent de X (ipoteza de homoscedasticitate 2 - se admite c legtura dintre Y i X este relativ stabil); - valorile variabilei reziduale nu sunt autocorelate (nu depind unele de altele); - legea de probabilitate a variabilei reziduale este legea normal cu media 0 i abatere standard Sy/x. Dac aceste ipoteze se verific, metoda celor mai mici ptrate asigur obinerea unor estimatori de maxim verosimilitate. Respectarea acestor ipoteze permite aplicarea unor teste statistice: a. verificarea semnificaiei estimatorilor funciei de regresie (aplicarea unor teste statistice 3 ); b. verificarea verosimilitii modelului de ajustare
The equation used to draw the best-fit straight line is called a regression equation and was first used by Sir Francis Galton (1822-1911) to show that when tall or short couples have children their heights tend to regress, or revert to the mean height of their parents. 2 Homoscedasticitatea este o proprietate a variaiei termenului de perturbare dintr-o ecuaie de regresie n care aceast variaie rmne constant n toate cazurile observate (condiie impus ca estimatorul celor mai mici ptrate s fie cel mai bun estimator liniar). 3 Un test statistic este o mrime calculat pentru testarea ipotezelor. In condiiile ipotezei nule H0, aceast mrime statistic urmeaz o distribuie de probabilitate pe care nu ar urmao n condiiile ipotezei alternative. Cu ct valoarea mrimii statistice de test se abate de la valorile critice ale distribuiei, cu att este mai puin plauzibil ca ipoteza nul s fie adevrat.
1

MasterMSS20112012

c. elaborarea de prognoze pe baza unui interval de ncredere. In general, previziunile bazate pe analiza regresiei se refer la: - valori medii condiionate ale variabilelor dependente (condiionarea fa de valori date ori prognozate ale variabilelor independente); - valori individuale ale valorilor dependente Y. Ambele tipuri de previziuni se obin din ecuaia de regresie determinat pe baza datelor experimentale: se obin aceleai valori numerice, deosebirea constnd n semnificaia acestor valori i n nivelul lor de precizie al estimrilor astfel obinute. Pentru estimarea unei valori individuale a variabilei dependente, nivelul de precizie este mai mic dect n cazul estimrii unei valori medii condiionate a variabilei respective.

Interpretarea statistic a rezultatelor regresiei


Baza informational pentru modelul liniar Y = a + b * x Serii de date neceesare ptr. regresia simpl: - pentru variabila explicativ/independent/exogen: Y1, Y2, ...Yn - pentru variabila explicat/dependent/endogena: x1, x2, ..., xn Calculul coeficientului a: a = y b x Calculul coeficientului b: b =
n x i y i xi y i
i =1 i =1 i =1 n 2 n n n

n n x x2 i =1 i =1 Calculul valorilor ajustate: Yi = a + b * xi

sau b =

(x
i =1

x) ( y i y )
i

(x
i =1

x) 2

Evaluarea erorilor de previziune se realizeaz folosind estimri cu intervale de ncredere, o astfel de estimare fiind cu att mai bun cu ct lungimea intervalului este mai mic i nivelul de semnificaie mai apropiat de 1. In general, un interval de ncredere cu nivelul de ncredere , ( 0 ,1 ) , pentru o caracteristic numeric a unei variabile aleatoare este un interval de numere reale de forma: (-t , +t ) unde: este o estimare a caracteristicii de interes, este o msur a mprtierii estimrilor posibile, t se determin din tabelele asociate unor repartiii probabilistice uzuale. Extremitile t ale unui interval de ncredere cu nivel de ncredere se stabilesc astfel nct s se poat spune c exist 100% anse ca estimarea a caracteristicii cercetate s se abat cu cel mult t de la valoarea real a acestei caracteristici (n mod echivalent, se spune c exist 100 (1-)% anse s omitem o eroare mai mic dect ). Din acest motiv, nivelul de ncredere se alege apropiat de 1 (de regul, 0,95 sau 0,99), echivalent cu faptul c diferena 1- (numit i prag / nivel de semnificaie) este apropiat de zero. Prin analiza de corelaie se urmrete: msurarea gradului de interdependen ntre variabila dependent Y i variabilele independente Xi, interdependen explicat prin ecuaia de regresie utilizat; evaluarea gradului de asociere ntre variabilele independente, atunci cnd ecuaia de regresie conine cel puin dou variabile independente Xi. Aceasta arat n ce msur dou valori sunt legate ntre ele intensitatea legturii este exprimat cu ajutorul a doi indicatori: coeficientul de corelaie (R) msoar puterea relaiei de dependen liniar printr-o valoare numeric ntre 1 i 1;

MasterMSS20112012

R=

( x

x
2 k

yk n x y

n x )

( y

2 k

n y)

o Dac R = 0 nu exist corelaie de tip liniar ntre Y i X (dar pot exista alte tipuri de dependen, de exemplu, neliniar) o Dac R > 0 i apropiat de valoarea 1, atunci creterile factorului X vor determina creteri ale variabilei Y o Dac R < 0 i apropiat de -1, atunci scderi ale factorului X vor determina scderi pentru Y. coeficientul de determinare (R2) care msoar reducerea relativ n variaia lui Y ce poate fi atribuit cunoaterii factorilor Xi i a relaiei Y = f(X). 2 2 exp Sy/ x n 2 2
R =
2 tot

=1

S2

n1

De exemplu, o valoare R2=0.76 indic c aproximativ 76% din variaia total a variabilei Y poate fi explicat prin variabilele dependente X incluse n model (o valoare 0.8 este considerat acceptabil).

Coeficientul corectat de determinare ( R ) se folosete atunci cnd numrul de observri este egal cu numrul coeficienilor estimai (deoarece fiecare punct de observare se va situa pe funcia de regresie, mrimea eantionului trebuie s fie suficient de mare pentru a estima coeficienii de regresie):

R = R2

k 1 ( 1 R 2 ) unde: nk

n reprezint numrul de observaii reale k este numrul coeficienilor de regresie.


In cazul regresiei multiple, R2 sau R reprezint o msur a efectului combinat al ansamblului variabilelor independente asupra variabilei dependente.
2

Semnificaia statistic a parametrilor modelului


Distribuia t (Student) 4 se folosete n testele ipotezelor pe eantioane mici i n care variana variabilei respective trebuie estimat n raport cu datele. Este o distribuie de probabilitate n form de clopot, n care valoarea medie este egal cu zero, dispersia variabilelor n jurul valorii medii fiind dependent de gradele de libertate 5 dictate de mrimea eantionului. Gradele de libertate arat numrul de elemente informaionale care pot varia independent unul de altul; se spune c un eantion de n observaii are n grade de libertate. De exemplu, calcularea unei medii simple a eantionului implic pierderea unui grad de libertate deoarece variaiile independente n n-1 din observaiile din eantion vor necesita o schimbare compensatorie n cel de al n lea grad de libertate, pentru a se menine valoarea medie a eantionului. Tot astfel, calcularea valorilor pentru un numr de k parametri n cadrul unui exemplu econometric implic pierderea a k grade de libertate, rmnnd (n-k).

Testul t este testul cel mai des utilizat n analizele economice cantitative i este definit ca raportul dintre o variabil

normal i o variabil 2 mprit la numrul gradelor de libertate. 5 Gradele de libertate arat numrul de elemente informaionale care pot varia independent unul de altul. Se spune c un eantion de n observaii are n grade de libertate. Totui, calcularea mediei simple a eantionului implic pierderea unui grad de libertate deoarece variaiile independente n n-1 din observaiile din eantion vor necesita o schimbare compensatorie n cel de al - n -lea grad de libertate, pentru a se menine valoarea medie a eantionului. Tot astfel, calcularea valorilor pentru un numr de k parametri n cadrul unui exemplu econometric implic pierderea a k grade de libertate, rmnnd (n-k). Gradele de libertate intr adesea ca parametri n distribuii de probabilitate (distribuia t sau 2 ) crora le poate afecta alura n mod fundamental.

MasterMSS20112012

Dac erorile sunt distribuite normal se ateapt ca aproximativ 68% dintre valorile lui y s fie situate ntr-un interval mai mic de e (eroarea standard de previziune) uniti fa de valoarea medie, sau 95% la mai puin de 2 e sau 99% la mai puin de 3 e . Fiecare din parametrii estimai este caracterizat de o eroare standard deoarece determinarea lor se face pe baza unui eantion de date; probabil un alt eantion ar duce la obinerea altor valori ale parametrilor modelului. Valoarea aproximativ a statisticii t de verificare a semnificaiei coeficienilor modelului se calculeaz cu relaia:
t= coeficient estimat valoarea coeficientului prin ipoteza eroarea s tan dard estimata a coeficientului

Ca regul, se realizeaz excluderea din model a oricrui coeficient pentru care t < 2 ,0 . Orice coeficient pentru care t > 2 ,0 este diferit de zero la un nivel de semnificaie de aproximativ 5%. Includerea n model a unor coeficieni cu valori absolute ale statisticii testului t substanial mai mici dect 2,0 va spori numrul parametrilor modelului i va duce la reducerea preciziei prediciei.

Tabelul 1. Interpretarea valorilor p p<0,01 0,01<p<0,05 0,05<p<0,1 0,1<p


Puternic eviden mpotriva H0 Eviden moderat mpotriva H0 Evidena sugereaz H0 fals Nu exist evidene mpotriva H0

Metoda regresiei simple


Pentru regresia liniar simpl X variabila explicativ - predictor Y variabila explicat variabila raspuns

Yi = a + b x i ,
a=r SDY SD X

b = y ax Unde: r coeficientul de corelatie intre X and Y; SDY i SDX sunt deviatiile standard ale varibilelor Y i X. Pentru a aprecia semnificaia estimatorilor: - pentru un set de date de volum n 30 se aplic testul t (Student) cu n-2 grade de libertate; - pentru n 30 se aplic testul z al distribuiei normale 6 formulnd ipotezele: H0: a=0 i b=0 Ha: a 0 i b 0

Teorema de limit central stabilete c suma (i media) unei mulimi de variabile aleatoare urmeaz o distribuie normal, dac eantionul este suficient de mare, indiferent de forma distribuiei de la care provine variabila individual. Teorema este folosit adesea pentru a explica ipoteza de normalitate a termenului de eroare n studiul econometric, care permite folosirea testului statistic t pentru testarea ipotezelor, deoarece acest termen de eroare se presupune c nglobeaz suma unei mulimi aleatoare de factori necunoscui (omii).

MasterMSS20112012

Dac t calc (a ) =

t i t calc (b) =

t atunci ipoteza H0 se respinge i se apreciaz

ca a i b sunt semnificativi din punct de vedere statistic. Tabelul 2. Interpretarea riscului de acceptare / respingere a H0
Nu respinge H0 este Decizie corect adevrat H0 fals este Eroare de tipul II (risc de tip ) Concluzia Respinge Eroare de tipul I (risc de tip ) Decizie corect

Situaia real

Eroare de tip I este dat de respingerea ipotezei nule atunci cnd, de fapt, aceasta ar fi trebuit acceptat; - se confirm/valideaz o ipotez care nu este adevrat - impact: concluzii gresite care pot duce la identificarea unor soluii/decizii inadecvate Eroarea de tip II este urmarea acceptrii ipotezei nule cnd, de fapt, aceasta trebuie respins: - n fapt, se ignor/ se pierde un efect important - in consecint, se pot trata dou alternative/ opiuni ca identice dei, n realitate, acestea sunt diferite. Verificarea veridicitii modelului are la baz principiul analizei dispersionale. Tabelul 3.
Sursa de variaie Explicat model prin Msura variaiei Gradul de influen Grade de libertate 1 Dispersii corectate
2 exp l

( y

y)

2 exp l 2 tot

1
n-2
2 rez

Rezidual

( y
( y

i ) y
2


1
2 exp/ 2 rez

2 rez 2 tot

n2
n-1
2 2 i

Total

y)

Se poate demonstra c raportul distribuie Fisher Snedecor. Dac F =


2 exp/ 2 rez

( y y ) = ( y y )
i i

este o variabil aleatoare cu o

F pentru n-k, respectiv k grade de libertate atunci variaia lui y este

explicat de variaia lui x. Raportul R =


R
2

( y (y

i i

y)

y )2

se numete raport de corelaie i exprim gradul

de fidelitate a modelului fa de dependena statistic dintre Y i X. Semnificaia statistic a lui R R2 F = ( n 2 ) F pentru n-k, se poate testa cu testul F (Fisher-Snedecor); dac 1 R2 respectiv k grade de libertate atunci R este semnificativ (n cazul regresiei liniare simple).

MasterMSS20112012

var iatie exp licata ( k 1 ) R2 ( k 1) F= = var iatie ne exp licata ( n k ) ( 1 R 2 ) ( n k )


Valoarea testului F se folosete pentru a testa semnificaia coeficienilor de regresie; se testeaz ipoteza potrivit creia variabila dependent este statistic necorelat cu variabilele independente incluse n model. Ipoteza nul H0 se formuleaz astfel: variana explicat este egal cu variana rezidual; testul F se calculeaz ca raport ntre cele dou variane i compar rezultatul cu o valoarea critic tabelat Fcrit. dac ipoteza H0 nu poate fi respins, atunci ponderea variaiei explicate va avea o pondere mic n variaia total a modelului de regresie. La limit, dac R2=0, atunci F=0. Pe msur ce valoarea F crete, ipoteza c variabila Y nu este dependent statistic de variabilele X considerate devine mai uor de respins. dac Fstat>Fcrit ipoteza nul poate fi respins (coeficienii de regresie au semnificaie statistic).

Metoda regresiei multiple


Variabila dependent Y este pus n dependen de variabilele Xk considerate factori explicativi pentru nivelul i al caracteristicii :

Yi = a 0 + a 1 x i 1 + a 2 x i 2 + ... + a n x in
(ecuaia de regresie n form aditiv) sau

Y i = a 0 x i1

a1

xi2

a2

.... x in

an

(n form multiplicativ). Distincia ntre cele dou forme este fundamental pentru interpretarea economic a coeficienilor de regresie: n cazul liniar, un coeficient ak, k=1,,n reprezint panta variaiei variabile Y fa de variabila explicativ Xk, adic modificarea lui Y ca urmare a variaiei cu o unitate a nivelului lui Xk (n ipoteza c toi ceilali factori rmn constani), n cazul neliniar, un coeficient ak reprezint coeficientul de elasticitate al variabilei explicate Y n funcie de variabila explicativ Xk (arat modificarea procentual a variabilei rezultative Y atunci cnd factorul Xk variaz cu un procent i toi ceilali factori sunt constani).

Metoda regresiei logistice


Regresia logistic modeleaz relaia dintre o mulime de variabile independente xi (categoriale, continue) i o variabil dependent dihotomic (nominal, binar) Y. O astfel de variabil dependent apare, de regul, atunci cnd reprezint apartenena la dou clase, categorii prezen/absen, da/nu etc. Ecuaia de regresie obinut, de un tip diferit de celelalte regresii discutate, ofer informaii despre: importana variabilelor n diferenierea claselor, clasificarea unei observaii ntr-o clas. De remarcat c diagrama de mprtiere a valorilor nu ofer nici un indiciu n privinta dependenelor. n asemenea cazuri, regresia liniar clasic nu ofer un model adecvat. Presupunem c valorile y (variabil binar) sunt codificate 0/1, valoarea 1 exprimnd n general apariia unui anumit eveniment, astfel nct ceea ce se caut este o estimare a probabilitii de producere a respectivului eveniment n funcie de valorile variabilelor independente.

Cazul unei singure variabile independente Modelul este:

MasterMSS20112012

P ( y = 1 x) =

e + x 1 + e + x

Sau
P( y = 1 x) ln( ) = + x. 1 P( y = 1 x) Cantitatea din partea stng este numit (transformarea) logit a probabilitii P(y=1|x). Semnificaia expresiei P(y=1|x) este evident: probabilitatea de realizare a valorii y=1 condiionat de valoarea x. Cu alte cuvinte, probabilitatea de clasare a observaiei x n clasa y=1, sau probabilitatea ca valoarea x s fie asociat cu producerea evenimentului y=1. Se noteaz P(y=1|x) cu p, conform notaiei de la modelul probabilist binomial (probabilitatea de succes). Transformarea logit este necesar pentru a proiecta probabilitatea p din intervalul (0,1) n intervalul (- , + ), fapt necesar n procesul de estimare a parametrilor. Modelul este legat direct de noiunea de odds (raport de anse), notat OR (odds report): p OR = 1 p care reprezint raportul dintre probabilitatea de succes i probabilitatea de insucces . Modelul se mai poate scrie: p = e + x . 1 p de unde interpretarea coeficientului : creterea cantitii logit atunci cnd x crete cu o unitate sau OR crete de e ori atunci cnd x crete cu o unitate.

Cazul mai multor variabile independente Modelul general este P( y = 1 x1 ,...., x p ) ) = + 1 x1 + 2 x 2 + ... + p x p ln( 1 P( y = 1 x1 ,..., x p )

unde p este P(y =1|x1,x2,,xp). Se poate obine imediat i forma exponenial echivalent. Interpretarea coeficienilor i este evident: creterea cantitii logit (logaritm din OR) atunci cnd xi crete cu o unitate (celelalte variabile x rmnnd constante).

MasterMSS20112012

Anexa: Metode bazate pe verificarea ipotezelor

In diferite stadii de analiz a caracteristicilor numerice ale unei colectiviti statistice apare deseori necesitatea formulrii i a verificrii unor ipoteze privind natura sau valorile unor parametri pentru variabilele aleatoare teoretice asociate caracteristicilor studiate. Orice presupunere privind repartiia sau caracteristicile variabilei aleatoare X, formulat pe baza unor informaii apriorice privind variabila aleatoare X se numete ipotez statistic. Pe baza informaiilor disponibile, analistul/cercettorul face o ipotez privind caracteristica numit ipotez de baz i notat H0, fa de care pot exista una sau mai multe ipoteze alternative Ha. Pentru simplitate, putem considera c, fa de ipoteza de baz H0, exist o singur ipotez alternativ Ha (dac ipoteza H0 este fals, atunci este adevrat alternativa sa Ha). Dac o ipotez statistic urmeaz a fi acceptat sau respins n funcie de datele uneia sau mai multor selecii se spune c se testeaz aceast ipotez, ipoteza testat fiind numit ipotez de baz sau ipotez nul; prin ipoteza alternativ se nelege o ipotez care poate fi adevrat atunci cnd H0 este fals i care ar putea fi acceptat atunci cnd ipoteza de baz este respins. Pentru verificarea ipotezelor statistice se folosesc metode specifice numite teste statistice. Prin test statistic se nelege o metod conform creia, pe baza datelor unei selecii, o ipotez de baz este fie acceptat fie respins. Dac ipoteza nul H0 are o singur alternativ Ha, iar n urma unui test statistic se decide respingerea ipotezei H0, atunci se accept ipoteza Ha. Dac ipoteza nul are mai multe alternative, atunci respingerea ipotezei nule implic acceptarea uneia dintre alternativele sale, fr a se preciza care dintre acestea este adevrat. Regula de decizie conform creia se accept sau se respinge ipoteza nul are la baz un criteriu de testare (n general, se folosete o funcie de selecie aleas n mod convenabil). Fie H0 o ipotez statistic de baz; o funcie de selecie C(x,n) se numete criteriu de testare a ipotezei H0 dac sunt ndeplinite urmtoarele condiii: a. repartiia variabilei aleatoare C(X,n) depinde de faptul dac ipoteza Ho este adevrat sau fals; b. n cazul n care H0 ar fi adevrat, atunci C(X,n) are repartiia complet specificat. In general n testarea ipotezei H0 decurge astfel: - se fixeaz o mulime de valori de numere reale I, care, de regul, este un interval. Mulimea I se numete regiune de respingere sau regiune critic; - se face o selecie de volum n din colectivitatea studiat, obinndu-se succesiv valorile x1, x2, ..., xn pentru caracteristica numeric analizat. Dac C(x 1 , x 2 , ..., x n ) I , atunci ipoteza nul H0 este acceptat; n caz contrar, H0 este respins. Atunci cnd se testeaz o ipotez statistic se pot produce erori: - dei ipoteza de baz H0 este adevrat, aceasta se respinge n urma testrii; apare ceea ce se numete eroare de tipul I; - dei ipoteza H0 este fals, aceasta se accept c ar fi adevrat; o astfel de eroare se numete eroare de tipul II. Evident, atunci cnd se testeaz o ipotez statistic, este de dorit ca pericolul comiterii unei erori s fie ct mai mic posibil. Prin nivel de semnificaie (alpha) al unui test statistic se nelege probabilitatea maxim acceptat de comitere a unei erori de tipul I. Probabilitatea comiterii unei erori de tipul II se numete risc de tipul II, se noteaz cu . Modul n care a fost definit criteriul de testare ofer posibilitatea controlului erorilor de tipul I i II.

MasterMSS20112012

Pentru controlul erorilor de tipul II, n locul riscului de tipul II - se mai folosete puterea testului =1-, definit ca probabilitatea respingerii ipotezei nule, atunci cnd aceasta este fals.

Anexa 2: Functii ptr. Aplicarea regresiei in EXCEL


Excel includes several array functions for performing linear regressionLINEST, TREND, FORECAST, SLOPE, and STEYXand exponential regressionLOGEST and GROWTH. These functions are entered as array formulas and they produce array results. You can use each of these functions with one or several independent variables. The following list provides a definition of the different types of regression: Linear regression produces the slope of a line that best fits a single set of data. Based on a year's worth of sales figures, for example, linear regression can tell you the projected sales for March of the following year by giving you the slope and y-intercept (that is, the point where the line crosses the y-axis) of the line that best fits the sales data. By following the line forward in time, you can estimate future sales, if you can safely assume that growth will remain linear. Exponential regression produces an exponential curve that best fits a set of data that you suspect does not change linearly with time. For example, a series of measurements of population growth will nearly always be better represented by an exponential curve than by a line. Multiple regression is the analysis of more than one set of data, which often produces a more realistic projection. You can perform both linear and exponential multiple regression analyses. For example, suppose you want to project the appropriate price for a house in your area based on square footage, number of bathrooms, lot size, and age. Using a multiple regression formula, you can estimate a price, based on a database of information gathered from existing houses. =INTERCEPT(known_y's,known_x's) Known_y's is the dependent set of observations or data. Known_x's is the independent set of observations or data. Remarks The arguments should be either numbers or names, arrays, or references that contain numbers. If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included. If known_y's and known_x's contain a different number of data points or contain no data points, INTERCEPT returns the #N/A error value. The SLOPE function returns the slope of the linear regression line. The slope is defined as the vertical distance divided by the horizontal distance between any two points on the regression line. Its value is the same as the first number in the array returned by the LINEST function. In other words, SLOPE calculates the trajectory of the line used by the FORECAST and TREND functions to calculate the values of data points. The SLOPE function takes the form =SLOPE(known_y's, known_x's). =SLOPE(known_y's,known_x's) where: Known_y's is an array or cell range of numeric dependent data points. Known_x's is the set of independent data points. Remarks The arguments must be either numbers or names, arrays, or references that contain numbers. If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included. If known_y's and known_x's are empty or have a different number of data points, SLOPE returns the #N/A error value. LINEST 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.

MasterMSS20112012

10

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-value is 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 LINEST returns is {mn,mn-1,...,m1,b}. LINEST can also return additional regression statistics. The LINEST and LOGEST functions return only the y-axis coordinates used for calculating lines and curves. The difference between them is that LINEST projects a straight line and LOGEST projects an exponential curve. LINEST(known_y's,known_x's,const,stats) Known_y's is the set of y-values you already know in the relationship y = mx + b. If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable. If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable. Known_x's is an optional set of x-values that you may already know in the relationship y = mx + b. The array 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 is 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 is a logical value specifying whether to return additional regression statistics. If stats is TRUE, LINEST returns the additional regression statistics, so 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. Statistic se1,se2,...,sen seb r2 Description The standard error values for the coefficients m1,m2,...,mn. The standard error value for the constant b (seb = #N/A when const is FALSE). The coefficient of determination. Compares estimated and actual yvalues, 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. The standard error for the y estimate. 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. 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 below shows use of F and df. The regression sum of squares. The residual sum of squares. For information about how ssreg and ssresid are calculated, see "Remarks" later in this topic.

sey F

df

ssreg ssresid

MasterMSS20112012

11

You can use the F statistic to determine whether these results, with such a high r2 value, occurred by chance. Assume for the moment that in fact there is no relationship among the variables, but that you have drawn a rare sample of 11 office buildings that causes the statistical analysis to demonstrate a strong relationship. The term "Alpha" is used for the

probability of erroneously concluding that there is a relationship.


F and df in LINEST output can be used to assess the likelihood of a higher F value occurring by chance. F can be compared with critical values in published F-distribution tables or Excels FDIST can be used to calculate the probability of a larger F value occurring by chance. The appropriate F distribution has v1 and v2 degrees of freedom. If n is the number of data points and const=TRUE or omitted, then v1=ndf1 and v2=df. (If const = FALSE, then v1=ndf and v2=df.) Excels FDIST(F,v1,v2) will return the probability of a higher F value occurring by chance. FDIST(x,degrees_freedom1,degrees_freedom2) X is the value at which to evaluate the function. Degrees_freedom1 is the numerator degrees of freedom. Degrees_freedom2 is the denominator degrees of freedom. Remarks If any argument is nonnumeric, FDIST returns the #VALUE! error value. If x is negative, FDIST returns the #NUM! error value. If degrees_freedom1 or degrees_freedom2 is not an integer, it is truncated. If degrees_freedom1 < 1 or degrees_freedom1 10^10, FDIST returns the #NUM! error value. If degrees_freedom2 < 1 or degrees_freedom2 10^10, FDIST returns the #NUM! error value. FDIST is calculated as FDIST=P(F>x), where F is a random variable that has an F distribution with degrees_freedom1 and degrees_freedom2 degrees of freedom.

FINV Returns the inverse of the F probability distribution.


If p = FDIST(x,...), then FINV(p,...) = x. The F distribution can be used in an F-test that compares the degree of variability in two data sets. For example, you can analyze income distributions in the United States and Canada to determine whether the two countries have a similar degree of diversity.

=FINV(probability,degrees_freedom1,degrees_freedom2) Probability is a probability associated with the F cumulative distribution. Degrees_freedom1 is the numerator degrees of freedom. Degrees_freedom2 is the denominator degrees of freedom.
Remarks If any argument is nonnumeric, FINV returns the #VALUE! error value. If probability < 0 or probability > 1, FINV returns the #NUM! error value. If degrees_freedom1 or degrees_freedom2 is not an integer, it is truncated. If degrees_freedom1 < 1 or degrees_freedom1 10^10, FINV returns the #NUM! error value. If degrees_freedom2 < 1 or degrees_freedom2 10^10, FINV returns the #NUM! error value. FINV can be used to return critical values from the F distribution. For example, the output of an ANOVA calculation often includes data for the F statistic, F probability, and F critical value at the 0.05 significance level. To return the critical value of F, use the significance level as the probability argument to FINV. FINV uses an iterative technique for calculating the function. Given a probability value, FINV iterates until the result is accurate to within 3x10^-7. If FINV does not converge after 100 iterations, the function returns the #N/A error value. Example FINV(0.01,6,4) equals 15.20675 Calculating the t-Statistics Another hypothesis test will determine whether each slope coefficient is useful in estimating the assessed value. The critical value can also be found using Excels TINV function.

TINV(probability,degrees_freedom) Probability is the probability associated with the two-tailed Student's tdistribution.

MasterMSS20112012 Degrees_freedom is the number characterize the distribution. of degrees of freedom with which

12 to

Remarks If either argument is nonnumeric, TINV returns the #VALUE! error value. If probability < 0 or if probability > 1, TINV returns the #NUM! error value. If degrees_freedom is not an integer, it is truncated. If degrees_freedom < 1, TINV returns the #NUM! error value. TINV returns that value t, such that P(|X|>t) = probability where X is a random variable that follows the t-distribution and P(|X|>t) = P(X<-t or X>t). A one-tailed t-value can be returned by replacing probability with 2*probability. For a probability of 0.05 and degrees of freedom of 10, the twotailed value is calculated with TINV(0.05,10), which returns 2.28139. The onetailed value for the same probability and degrees of freedom can be calculated with TINV(2*0.05,10), which returns 1.812462. Note In some tables, probability is described as (1-p). Given a value for probability, TINV seeks that value x such that TDIST(x, degrees_freedom,2) = probability. Thus, precision of TINV depends on precision of TDIST. TINV uses an iterative search technique. If the search has not converged after 100 iterations, the function returns the #N/A error value. The STEYX function calculates the standard error of a regression, a measure of the amount of error accrued in predicting a y for each given x. This function takes the form =STEYX(known_y's, known_x's). The TREND function LINEST returns a mathematical description of the straight line that best fits known data. TREND finds points that lie along that line and that fall into the unknown category. You can use the numbers returned by TREND to plot a trend linea straight line that helps make sense of actual data. You can also use TREND to extrapolate, or make intelligent guesses about, future data based on the tendencies exhibited by known data. (Be careful. Although you can use TREND to plot the straight line that best fits the known data, TREND can't tell you if that line is a good predictor of the future. Validation statistics returned by LINEST can help you make that assessment.) The TREND function takes the form =TREND(known_y's, known_x's, new_x's, const). The first two arguments represent the known values of your dependent and independent variables. As in LINEST, the known_y's argument is a single column, a single row, or a rectangular range. The known_x's argument also follows the pattern described for LINEST. The third and fourth arguments are optional. If you omit new_x's, the TREND function considers new_x's to be identical to known_x's. If you include const, the value of that argument must be TRUE or FALSE (or 1 or 0). If const is TRUE, TREND forces b to be 0. To calculate the trend-line data points that best fit your known data, simply omit the third and fourth arguments from this function. The results array will be the same size as the known_x's range. To create these values, we selected the range ...... and entered =TREND(....., .....) as an array formula using Ctrl+Shift+Enter. Calculating exponential regression Unlike linear regression, which plots values along a straight line, exponential regression describes a curve by calculating the array of values needed to plot it. The equation that describes an exponential regression curve is y = b * m1x1 * m2x2 * * mnxn If you have only one independent variable, the equation is y = b * mx The LOGEST function The LOGEST function works like LINEST, except that you use it to analyze data that is nonlinear, and it returns the coordinates of an exponential curve instead of a straight line. LOGEST returns coefficient values for each independent variable plus a value for the constant b. This function takes the form =LOGEST(known_y's, known_x's, const, stats). LOGEST accepts the same arguments as the LINEST function and returns a result array in the same fashion. If you set the optional stats argument to TRUE, the function also returns validation statistics. Note The LINEST and LOGEST functions return only the y-axis coordinates used for calculating lines and curves. The difference between them is that LINEST projects a straight line and LOGEST projects an exponential curve. You must be careful to match the appropriate function to the analysis at hand. The LINEST function might be more appropriate for sales projections, and the LOGEST function might be more suited to applications, such as statistical analyses or population trends.

MasterMSS20112012

13

LOGEST(known_y's,known_x's,const,stats) Known_y's is the set of y-values you already know in the relationship y = b*m^x. If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable. If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable. Known_x's is an optional set of x-values that you may already know in the relationship y = b*m^x. The array 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 range of cells with a height of one row or a width of one column (which is also known as a vector). 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 is a logical value specifying whether to force the constant b to equal 1. If const is TRUE or omitted, b is calculated normally. If const is FALSE, b is set equal to 1, and the m-values are fitted to y = m^x. Stats is a logical value specifying whether to return additional regression statistics. If stats is TRUE, LOGEST returns the additional regression statistics, so the returned array is {mn,mn-1,...,m1,b;sen,sen-1,...,se1,seb;r 2,sey; F,df;ssreg,ssresid}. If stats is FALSE or omitted, LOGEST returns only the m-coefficients and the constant b. For more information about additional regression statistics, see LINEST. Remarks The more a plot of your data resembles an exponential curve, the better the calculated line will fit your data. Like LINEST, LOGEST returns an array of values that describes a relationship among the values, but LINEST fits a straight line to your data; LOGEST fits an exponential curve. For more information, see LINEST. When you have only one independent x-variable, you can obtain y-intercept (b) values directly by using the following formula: Y-intercept (b): INDEX(LOGEST(known_y's,known_x's),2) You can use the y = b*m^x equation to predict future values of y, but Microsoft Excel provides the GROWTH function to do this for you. For more information, see GROWTH. 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 in the same row and semicolons to separate rows. Separator characters may be different depending on your locale setting in Regional Settings or Regional Options in Control Panel. You should note that the y-values predicted by the regression equation may not be valid if they are outside the range of y-values you used to determine the equation. The GROWTH function Where the LOGEST function returns a mathematical description of the exponential regression curve that best fits a set of known data, the GROWTH function finds points that lie along that curve. The GROWTH function works like its linear counterpart, TREND, and takes the form =GROWTH(known_y's, known_x's, new_x's, const). GROWTH(known_y's,known_x's,new_x's,const) Known_y's is the set of y-values you already know in the relationship y = b*m^x. If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable. If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable. If any of the numbers in known_y's is 0 or negative, GROWTH returns the #NUM! error value. Known_x's is an optional set of x-values that you may already know in the relationship y = b*m^x. The array 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).

MasterMSS20112012

14

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. New_x's are new x-values for which you want GROWTH to return corresponding y-values. New_x's must include a column (or row) for each independent variable, just as known_x's does. So, if known_y's is in a single column, known_x's and new_x's must have the same number of columns. If known_y's is in a single row, known_x's and new_x's must have the same number of rows. If new_x's is omitted, it is assumed to be the same as known_x's. If both known_x's and new_x's are omitted, they are assumed to be the array {1,2,3,...} that is the same size as known_y's. Const is a logical value specifying whether to force the constant b to equal 1. If const is TRUE or omitted, b is calculated normally. If const is FALSE, b is set equal to 1 and the m-values are adjusted so that y = m^x. Remarks Formulas that return arrays must be entered as array formulas after selecting the correct number of cells. When entering an array constant for an argument such as known_x's, use commas to separate values in the same row and semicolons to separate rows.