# How to apply a logistic + an OLS model to the same data set?

I have a data set measuring rock detection depths $Y$ based on the distance from some point of interests $X$, which are classified based on geophysical criteria. Each observation $Y$ is set after plowing the ground to determine if A) there is any chance of rock formation at all and B) what is the distance of the rock from the ground. In most cases the detection is unsuccessful and $Y$ is set to 0. Otherwise $Y$ it's set to a measure of rock depth.

There is a linear relationship between $\log(Y)$ and $\log(X)$ as shown in the plot, for $Y \ne 0$. To allow for the $Y$ log transformation I added a small constant value, 0.00001 which is an order of 10 lower than $Y$ smallest value other than 0.

:

How should I model this data for prediction?

I thought about a convoluted solution using logistic regression to determine whether Y is higher than 0.0001 or not, then OLS to predict Y for each X when the result of the logistic estimator is higher than 50%. Is there a more sound approach?

• Those data sure look a little screwy. Can you say more about what they are & where they come from? What do you want the model for? Oct 3, 2014 at 22:03
• Possibly censored regression would apply. I learned a lot from stats.stackexchange.com/questions/49443/… Oct 3, 2014 at 22:25
• My first thought would be a zero-inflated glm (say gamma with log-link and log(X) as a predictor) .... but looking at your log-log plot, the non-zero part of the distribution looks like a mixture of discrete and continuous, which makes me wonder if there's some important feature of the data that I've missed. Oct 4, 2014 at 5:44
• @Glen_b That is correct, data is a mixture of discrete (any rock detection) and continuos (depth). $X$ is the distance from the POI, which linearly predicts rock depth $only$ when rock is actually present. Oct 4, 2014 at 9:51

Unless there is a method that is tailored to what the 0.0001 values really mean, a good model to consider is one of the cumulative probability ordinal models such as the proportional odds ordinal logistic model. Such models can handle continuous $Y$ and also deal with arbitrarily large amounts of clumping at specific $Y$ values. The R rms package orm function is designed to handled continuous $Y$ fairly efficiently even when the model has thousands of intercepts. In ordinal models you need one intercept per unique value of $Y$ less one.
• $X$ is mainly a measure of distance from some POI of interesets. The idea is that the farther the probe from the POI, the higher the chance that the probe will detect a certain kind of rock formation. Indeed that's confirmed by the linear relationship in the plot, except for those cases where no rock was found at all. Oct 5, 2014 at 13:52