1
$\begingroup$

I am having a question in regression analysis in JMP or any other tool.

I have one dependent variable $y$ and $2$ independent variables $x_1$ and $x_2$.

For example:

time $= y -$ per row time ( total time divided by total rows, $x_2$).

new rows added to $db = x_1$.

total rows in $db = x_2$

total time $= t$ for a database query

observed time $y$ (per row) $=$ total time $t /$ total rows $x_2$

$x_1$ is number of new rows added to database.

As you can see, data base rows ($x_2$) increase as new rows are added ($x_1$) . So per row time ($y$) decreases when number of rows added to $db$ are more.

sample data : $$ \begin{matrix} y & x_1 & x_2 \\ 0.000465116 & 0 & 86 \\ 0.000659091 & 1 & 44 \\ 0.000597561 & 2 & 82 \\ 0.000635294 & 2 & 85 \\ 0.00053271 & 2 & 107 \\ 0.000590909 & 2 & 110 \\ 0.0005 & 2 & 244 \\ 0.000577075 & 2 & 253 \\ 0.000685714 & 3 & 35 \\ 0.000947368 & 3 & 38 \\ 0.000717949 & 3 & 39 \\ 0.000755556 & 3 & 45 \\ 0.000574468 & 3 & 47 \\ 0.000716981 & 3 & 53 \end{matrix} $$

Can anyone suggest how I should approach this ?

I am getting $R^2$ as $50\%$ when I only try to model $y$ and $x_1 \to$ meaning $50\%$ of my data is correct using this linear fit.

Should I be modeling, per row time ($y$) with number of rows added ? Its a bit confusing I know. I would be happy to clear the details if anyone require more information.

$\endgroup$

2 Answers 2

1
$\begingroup$

If you speak about multilinear regression, start using $y=a+b x1+c x2$. Come back with your results and we could continue the discussion.

By the way, you have a very surprizing way for the interpretation of $R^2$

$\endgroup$
6
  • $\begingroup$ I was also puzzled by the OPs use of $R^{2}$. $\endgroup$
    – Chinny84
    Commented Jan 25, 2014 at 17:53
  • $\begingroup$ as far as i know from this link en.wikipedia.org/wiki/Coefficient_of_determination determines, how good is the fit. (r^2 = 1 means the chosen model correctly fits the data. $\endgroup$ Commented Jan 25, 2014 at 18:45
  • $\begingroup$ $R^2=1$ means that the model is perfect. When, in physics, I have an $R^2=0.98$, I am not happy at all. Take points along a circle (not centered at the origin) and perform a linear regression. You would be surprized ! Did you perform the regression I suggested (you can use Excel) ? $\endgroup$ Commented Jan 25, 2014 at 18:58
  • $\begingroup$ yes, when i try to fit my data in this : y=a(x)^b, I get this as my model: y = 5.953990281·10-4 ( x )^(0.04015083873) with an RSS of rss = 1.335389025·10^-6. this RSS value seems to be less. but data (y) is of order 10^-3. (0.0004..) $\endgroup$ Commented Jan 25, 2014 at 19:15
  • $\begingroup$ @user24 04319. The title of your post is $"help$ $in$ $multiple$ $linear$ $regression"$. Do you think that what you tried corresponds to what you asked ? By the way, all your numbers are less than 0.001 and you have 14 data points; so, a RSS of 10^(-6) is HUGE. $\endgroup$ Commented Jan 25, 2014 at 19:22
0
$\begingroup$

Data

Sequence of $m=14$ points: $$ \left\{ x_{k}, y_{k}, z_{k} \right\}_{k=1}^{m} $$

Model

A plane in $\mathbb{R}^{3}$: $$ z(x,y) = a_{0} + a_{1} x + a_{2} $$

Linear system

$$ \begin{align} \mathbf{A} a &= z \\ % A \left[ \begin{array}{ccr} 1 & 0 & 86 \\ 1 & 1 & 44 \\ 1 & 2 & 82 \\ 1 & 2 & 85 \\ 1 & 2 & 107 \\ 1 & 2 & 110 \\ 1 & 2 & 244 \\ 1 & 2 & 253 \\ 1 & 3 & 35 \\ 1 & 3 & 38 \\ 1 & 3 & 39 \\ 1 & 3 & 45 \\ 1 & 3 & 47 \\ 1 & 3 & 53 \\ \end{array} \right] % a \left[ \begin{array}{c} a_{0} \\ a_{1} \\ a_{2} \end{array} \right] % &= % z \left[ \begin{array}{l} 0.000465116 \\ 0.000659091 \\ 0.000597561 \\ 0.000635294 \\ 0.00053271 \\ 0.000590909 \\ 0.0005 \\ 0.000577075 \\ 0.000685714 \\ 0.000947368 \\ 0.000717949 \\ 0.000755556 \\ 0.000574468 \\ 0.000716981 \end{array} \right] % \end{align} $$

Normal equations

$$ \begin{align} \mathbf{A}^{*} \mathbf{A} a &= \mathbf{A}^{*} z \\ % \left[ \begin{array}{rrr} 14 & 31 & 1268 \\ 31 & 79 & 2577 \\ 1268 & 2577 & 181608 \\ \end{array} \right] % a \left[ \begin{array}{c} a_{0} \\ a_{1} \\ a_{2} \end{array} \right] % &= % \left[ \begin{array}{c} 0.00895579 \\ 0.0207203 \\ 0.749 \end{array} \right] % \end{align} $$

Normal equations solution

$$ \begin{align} % a &= \left( \mathbf{A}^{*} \mathbf{A} \right)^{-1} \mathbf{A}^{*} z \\ % &= % \frac{1}{8935490} \left[ \begin{array}{rrr} 7706103 & -2362212 & -20285 \\ -2362212 & 934688 & 3230 \\ -20285 & 3230 & 145 \\ \end{array} \right] % \left[ \begin{array}{l} 0.00895579 \\ 0.0207203 \\ 0.749 \end{array} \right] \\[5pt] % & = % \left[ \begin{array}{l} \phantom{-}0.000545584 \\ \phantom{-}0.0000705953 \\ -0.000000686778 \end{array} \right] % \end{align} $$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .