- #1

- 84

- 8

- I
- Thread starter BillKet
- Start date

- #1

- 84

- 8

- #2

jedishrfu

Mentor

- 12,089

- 5,768

Knowing that, we might find that certain fields of research prefer certain methods to be used over other methods.

- #3

Dale

Mentor

- 30,137

- 6,573

No, definitely not. If different methods always gave exactly the same result then there would be no point in having different methods at all.Shouldn't I get the exactly same result both ways?

The errors in y, are they large or can they be neglected?And in case the answer is no, which method should I use and why?

- #4

- 84

- 8

The data is from a molecular spectroscopy experiment. For people working in the field, this is similar to a King plot fit, but for molecular terms (when the field shift is important). z corresponds to a frequency shift between different molecules, y is the change in radius of one of the atoms of the molecules between different molecules and x is the frequency level that is being tested.

Knowing that, we might find that certain fields of research prefer certain methods to be used over other methods.

- #5

- 84

- 8

Thank you for your reply! To be honest I wasn't even sure if they can count as different, I assumed they are the same method, but it one case it do it in 2 steps while in the other in one step only.No, definitely not. If different methods always gave exactly the same result then there would be no point in having different methods at all.

The errors in y, are they large or can they be neglected?

The errors on y are a lot smaller than the errors on z. From what I've seen ignoring them doesn't produce a big difference. The errors on z contain also systematic uncertainties and the statistics for them are a lot lower, so the error is quite big.

- #6

Dale

Mentor

- 30,137

- 6,573

Then doing a standard least squares fit should be fine. Stepwise first are always a little sketchy, so I would avoid it. The smaller error is most likely producing a larger bias.The errors on y are a lot smaller than the errors on z.

I would probably fit to the following model ##z= ay + bx + cxy + d## with a standard linear model. In R this model would be written

Code:

`z~x*y`

- #7

- 84

- 8

Oh I see! So if the fit is good b and d should be consistent with zero, right? Thanks a lot! Could you please explain to me a bit more why doing it in 2 steps gives me a different error (it is actually ~3 times smaller)?Then doing a standard least squares fit should be fine. Stepwise first are always a little sketchy, so I would avoid it. The smaller error is most likely producing a larger bias.

I would probably fit to the following model ##z= ay + bx + cxy + d## with a standard linear model. In R this model would be writtenwhere the inclusion of the other terms is so standard that they are simply assumed. Leaving out intercept terms and lower order terms can introduce bias. This model will give you the best unbiased linear estimator.Code:`z~x*y`

- #8

Dale

Mentor

- 30,137

- 6,573

I am surprised that it is that much different. Without the data I can’t really tell. There might be some substantial covariance or multicolinearity that is constrained away in the stepwise approach.Oh I see! So if the fit is good b and d should be consistent with zero, right? Thanks a lot! Could you please explain to me a bit more why doing it in 2 steps gives me a different error (it is actually ~3 times smaller)?

- #9

- 84

- 8

Please find the data I am using below. The errors are combined statistical and systematic. They come from different experiments (hence the different range of errors). Just to give a bit more details, the function I actually need to fit is this ##z=y(a+b(x+0.5)/4.186)## (just a redefinition of a and b for completeness). Each sub-array of z corresponds to a value of x. For example the second entry of z should be written as: ##0.176=-0.216(a+b(0+0.5)/4.186)## Please let me know if I can provide further details.I am surprised that it is that much different. Without the data I can’t really tell. There might be some substantial covariance or multicolinearity that is constrained away in the stepwise approach.

$$y = [-0.312, -0.216, -0.080, 0. , 0.210 ]$$

$$y_{err}=[0.015, 0.010, 0.004, 0.00001,0.01]$$

$$x=[0,1,2,3]$$

$$z = [[ 0.268, 0.176, 0.117 , -0. , -0.184],

[ 0.277, 0.177, 0.100, -0. , -0.179]

[ 0.274, 0.178, 0.121, -0. , -0.250]

[ 0.298, 0.063, 0.001, -0. , -0.374 ]]$$

$$z_{err}=[[0.008, 0.015, 0.028, 0.008, 0.021],

[0.005, 0.013 , 0.018, 0.004, 0.012],

[0.014, 0.016, 0.053, 0.016, 0.042],

[0.059, 0.088, 0.163, 0.055, 0.151]]$$