# Linear Regression Analysis

I am very new to linear regression analysis and I am trying to solve my first examples, most of the examples I have come across contained some tables and data where I could easily use the formulas I know and solve them. However, I have just come across an example that does not have much data and I have no idea where I should start and which formulas I should use to initiate.

we assume that the number of schoolchildren's close relationship has a linear association with the likelihood (0-100%) that a child becomes bullied in the classroom. We build a regression model where we predict the likelihood of becoming bullied with the number of friends. We found out that if a child has no friends, the likelihood of being bullied is 70%. We also know that the regression coefficient (beta) for the variable 'number of friends' is -10.

This question is asking me to write the regression equation and also predict the likelihood of being bullied if the child has 14 friends.

Shouldn't I simply use the following formula? But isn't something missing in the question? ŷ = β0 + β1x

• What you should be looking at is logistic regression, not linear regression. Linear regression doen't give you probabilities. – JimBoy Oct 17 '15 at 10:45
• Am I missing something, or do you just plug the numbers into the equation? $\beta_0$ is clearly 70, and $\beta_1$ is -10. So $\hat{y}_{14} = 70 + (-10) \cdot 14 = -70 = 0$. If you assume this is the only variable influencing the likelihood of being bullied, then this is logical. I think perhaps the wording "likelihood" and "probability" may be confusing in this instance because those are typically not the domain of linear regression, but in this instance it just seems to be the response variable. Perhaps someone can show me why I'm wrong. – Chris C Oct 17 '15 at 15:36

Simple illustration to know why the linear regression in this case does not work , and what is the logistic regression .

First of all , you have to know that your dependent variable $y$ (child becomes bullied ) is a binary variable , that means it takes two outcomes either Yes (becomes bullied ) or No (does not become bullied ).Let us create a dummy variable to indicate if an observation yes or no :

$y=1$ if yes

$y=0$ if no

In the example we want to know what determines that a child becomes bullied , our independent variable in this case is the number of friends $x$

Suppose that we run the regression model:

$Yes(y=1) =\alpha +\beta{x_i} + error$

Now suppose we got the following outputs

$yes=-1+0.5{x_i}$

Since our dependent variable is binary , that means we want to know what makes it change from 0 to 1 , in other words , we want to know what increase the likelihood of being bullied $Pr(y=1)$ So our model could be $Pr(y=1)=-1+0.5{x_i}$

Now can you calculate the likelihood that a child being bullied who has 25 friends ?.I suppose ,you know that the probability is bounded wherby $0\leq p \leq 1$.

If you get a strange result you have to find out a function which satisfies this condition $0\leq p \leq 1$ (squared function or exponential function..etc)

If it doesn't have much data you may have a problem.

If your data on bullying consists of a yes/no variable (bullied vs. not) for each child, then @JimBoy is right and you should use logistic regression. If you haven't studied that yet, then you should either do so or look for a different problem. Linear regression (which is what people usually mean when they just say "regression") is for dependent variables that are continuous - that is, they can take on any value.

If you tell us what data the example you are using does supply, we may be able to give a more comprehensive answer

• Thank you for your reply. All that is provided by the question is exactly what I have written. There is absolutely nothing else found in the task. I am having problem even writing the equation of the line. Is it even possible to write the equation based on the information given by the question? – l.. Oct 17 '15 at 11:52
• Yes, but the task seems kind of silly. Is this homework? If so, you should add the self study tag. – Peter Flom Oct 17 '15 at 11:57
• How can I do that? How can I write the equation based on the information provided? No, this is not homework, but basically just an exercise from a series of tasks I asked my lecturer to provide me to practice the topic. – l.. Oct 19 '15 at 12:06
• You have the probability when the IV = 0 and you have the intercept and you have the parameter estimate (10). So it should be some simple algebra from the logistic regression formulas which are hard to type in a comment but see e.g. en.wikipedia.org/wiki/Logistic_regression – Peter Flom Oct 19 '15 at 12:14

Using the linear probability model (*), you can solve your problem using the given equation. When you've used the values to make a prediction, you'll probably get an unexpected likelihood (hint: what are the range of possible likelihoods? can they be negative?), which is one of the reasons why you'll learn logistic regression. Sometimes though this model can be usefull as well.