JMP18.1.1
I'm working with measurement data, where I'd like to compute a line of fit at a particular datapoint, using the neighbouring datapoints. To then obtain an x-axis intercept for y=0.
Looking around and trying to solve this myself, it seems I can do it using either the 'Linear Regression' or 'Least Squares Solve' function in JMP..
I've done this in a column formula (with an if statement to identify the datapoint about which to evaluate):
x = J( 2, 1, 0 );
y = J( 2, 1, 0 );
x[1, 1] = Lag( :y_column, 1 );
x[2, 1] = Lag( :y_column, -1 );
y[1, 1] = Lag( :x_column, 1 );
y[2, 1] = Lag( :x_column, -1 );
Coeffs = Linear Regression( y, x )[1];
Coeffs[1];
This code produces the right output, but when it runs it throws up an error:
'Unable to estimate the variance of parameter estimates because the rank of X equals the number of rows of X'
I don't really understand what the problem here is. I only want the intercept anyway. Is there a simple way to fix this? Or turn off the warning?
I can try a similar approach with the Least Squares function, but that throws up the same error.
I've made an example table which shows the problem. Rerun the formula on that table to see the error.
Thanks