# A Question about P-value and Prediction

#### upcxiaos

##### New Member
My objective:

I have two groups of data and both of them are composed of x and y, I use the data in "group A" to find a linear relationship between x and y. Then I try to exam the whether the "group B"'s points belong to "group A".

They way I wanna try is:

use lm() to do the linear curve fitting, and pick one point in "group B" and check the p-value for it to belong the "group A".

I know how to do the linear curve fitting, but I dont know how to calculate the p-value for the points in "group B".

##### Ninja say what!?!
hmmm...there seems to be a lot of theory missing from your question.

By "pick one point in group B and check the p-value" what do you mean? How will testing one point tell you if group B as a whole belong's to group A? And what exactly do you mean by "belong"? That it follows the same statistical model? Also, how do you know that the points in group A follow a linear model?

#### BGM

##### TS Contributor
I am not sure either, but my best guess is the following set up:

Assume that there is two groups of data satisfying the following simple regression model respectively:

$$y_i^A = \beta_0^A + \beta_1^Ax_i^A + \epsilon_i^A$$

$$y_i^B = \beta_0^B + \beta_1^Bx_i^B + \epsilon_i^B$$

And he want to test

$$H_0: \beta_0^A = \beta_0^B ~~ \text{and} ~~ \beta_1^A = \beta_1^B$$

and gives the corresponding p-value of the test.

#### upcxiaos

##### New Member
hmmm...there seems to be a lot of theory missing from your question.

By "pick one point in group B and check the p-value" what do you mean? How will testing one point tell you if group B as a whole belong's to group A? And what exactly do you mean by "belong"? That it follows the same statistical model? Also, how do you know that the points in group A follow a linear model?
sorry for the confusion.

pick one point in group B and check the p-value" what do you mean?
pick one point in group B and calculate the possibility it follows the same statistical model of group A

How will testing one point tell you if group B as a whole belong's to group A? And what exactly do you mean by "belong"? That it follows the same statistical model?
test one point and tell if this point follows the same statistical model of group A.

Also, how do you know that the points in group A follow a linear model?
I have lots of points and the linear model fits well. I can try to use some other models to fit the data, but my point is "after that, how can I tell whether another point follows the same statistical model or not"

Thanks