# [R] special question on regression

Sun Jul 17 20:32:29 CEST 2011

```Hello,

@Bert: I didn't expect a full tutorial service but probably a hint of
the Masters of statistics ;)

Anyway I posted my question again on a special statistic
that this is the case here. As so far as I understand it is there
the dependent variable censored. In my case is the independent
variable not a fixed value but rather a range.

/J

Am 17.07.2011 um 16:15 schrieb Bert Gunter:

> Johannes:
>
> R is not a statistical tutorial service, although kind and able
> helpeRs sometimes do reply to such queries. You should try such a
> service, for example:
>
> http://stackoverflow.com/
>
> FWIW, this is an example of censoring in regression. R has packages
> for this, but you need to learn more or get help to use them properly,
> as you, yourself, indicated.
>
> -- Bert
>
> On Sun, Jul 17, 2011 at 3:01 AM, Johannes Radinger
>> Hello R-people!
>>
>> I have a general statistical question about regressions. I just
>> want to
>> describe my case:
>>
>> I have got a dataset of around 150 observations and 1 dependent and 2
>> independent variables.
>> The dependent variable is of metric nature (in my case meters in a
>> range
>> from around 0.5-10000 m). The first independent is also metric (in mm
>> ranging from 50-700 mm) and it is assumed to be in a linear
>> relation with
>> the dependend one. So that is not a problem at all to do a
>> typicall linear
>> regression on that.
>>
>> No there is the second independent variable. This is also of
>> metric nature
>> and gives information on time (ranging from 1 day to 800 days) but
>> here
>> sometimes is this variable not exactly clear, I know for example a
>> range
>> (1-2 days) or less than x days etc. So my dataset could look like
>> this:
>>
>> measured dependent variable in days:
>> 1
>> 15
>> 7-9
>> <2
>> <9
>> 24
>> 4
>> 4-7
>>
>> So my question: Is there a general method to include such types of
>> variables
>> into a regression analysis?
>>
>> Secondly I assume that there is not a linear relation given, it is
>> more of a
>> logarithmic nature so that the influence of the time on the dependent
>> variable decreases with increasing size.
>>
>> So in short my questions:
>> * How can I use variable values like <5 or 4-5 in a regression
>> * Is it possible to combine the linear relationship with a
>> logarithmic one
>> in a multiple regression
>> *How can that be done in R, are there any special packages you'd
>> recommend?
>>
>> Thank you very much
>>
>> best regards
>> Johannes
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
>
> --
> "Men by nature long to get on to the ultimate truths, and will often
> be impatient with elementary studies or fight shy of them. If it were
> possible to reach the ultimate truths without the elementary studies
> usually prefixed to them, these would not be preparatory studies but
> superfluous diversions."
>
> -- Maimonides (1135-1204)
>
> Bert Gunter
> Genentech Nonclinical Biostatistics
> 467-7374