Registered User Joined: 11/28/2005 Posts: 38
|
I am looking to create a PCF that provides the correlation coefficient (r2) of a 60 period linear regression. The aim is to use the value to help determine the quality of the slope of the linear regression line.
Any help would be much appreciated.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Please try the following Indicator Formula for the 60-Period R-Squared:
((((60 - 1) / 2) * AVGC60 - (C1 + 2 * C2 + 3 * C3 + 4 * C4 + 5 * C5 + 6 * C6 + 7 * C7 + 8 * C8 + 9 * C9 + 10 * C10 + 11 * C11 + 12 * C12 + 13 * C13 + 14 * C14 + 15 * C15 + 16 * C16 + 17 * C17 + 18 * C18 + 19 * C19 + 20 * C20 + 21 * C21 + 22 * C22 + 23 * C23 + 24 * C24 + 25 * C25 + 26 * C26 + 27 * C27 + 28 * C28 + 29 * C29 + 30 * C30 + 31 * C31 + 32 * C32 + 33 * C33 + 34 * C34 + 35 * C35 + 36 * C36 + 37 * C37 + 38 * C38 + 39 * C39 + 40 * C40 + 41 * C41 + 42 * C42 + 43 * C43 + 44 * C44 + 45 * C45 + 46 * C46 + 47 * C47 + 48 * C48 + 49 * C49 + 50 * C50 + 51 * C51 + 52 * C52 + 53 * C53 + 54 * C54 + 55 * C55 + 56 * C56 + 57 * C57 + 58 * C58 + 59 * C59) / 60) / SQR(((60 ^ 2 - 1) / 12) * ((C ^ 2 + C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 + C15 ^ 2 + C16 ^ 2 + C17 ^ 2 + C18 ^ 2 + C19 ^ 2 + C20 ^ 2 + C21 ^ 2 + C22 ^ 2 + C23 ^ 2 + C24 ^ 2 + C25 ^ 2 + C26 ^ 2 + C27 ^ 2 + C28 ^ 2 + C29 ^ 2 + C30 ^ 2 + C31 ^ 2 + C32 ^ 2 + C33 ^ 2 + C34 ^ 2 + C35 ^ 2 + C36 ^ 2 + C37 ^ 2 + C38 ^ 2 + C39 ^ 2 + C40 ^ 2 + C41 ^ 2 + C42 ^ 2 + C43 ^ 2 + C44 ^ 2 + C45 ^ 2 + C46 ^ 2 + C47 ^ 2 + C48 ^ 2 + C49 ^ 2 + C50 ^ 2 + C51 ^ 2 + C52 ^ 2 + C53 ^ 2 + C54 ^ 2 + C55 ^ 2 + C56 ^ 2 + C57 ^ 2 + C58 ^ 2 + C59 ^ 2) / 60 - AVGC60 ^ 2))) ^ 2
Need help writing a PCF for r-squared
-Bruce Personal Criteria Formulas TC2000 Support Articles
|