Katharina May
2009-Aug-08 18:27 UTC
[R] linear model: Test difference between coefficients and given values (t.test?)
Hi there, I've got a question which is really trivial for sure but still I have to ask as I'm not making any progress solving it by myself (please be patient with an undergraduate student): I've got a linear model (lm and lmer fitted with method="ML"). Now I want to compare the coefficients (slope, intercept, not the random effects) of both models with a given value (e.g. intercept=0.5, slope=2) to see if the values estimated with the models are significantly different from the given values. I heard about t.test, but I'm sorry to say that I'm not quite understanding what I have to provide as arguments. I would be more than happy if somebody can point out an example similar to the comparison I have to do... Thanks, Katharina
Katharina May
2009-Aug-08 20:15 UTC
[R] linear model: Test difference between coefficients and given values (t.test?)
Thanks to somebody I got the hint to use offset for the purpose of validating if there's a difference between the intercept and slope of a model and some provided values for the coefficients intercept and slope. I read ?model.offset and I'm still struggling to use it for my purpose. If I understood the concepts correctly, offset can be used to define a known coefficient of a model, so therefore I could create two models based on the same data like my original one with an additional offset term (one model with intercept specified and one with the slope specified)? Sorry for troubling you: I struggling with the data analysis of my bachelor thesis and just want to compare the coefficients of my linear regression to published ones... a method often used I guess, but still I cannot find any appropriate documentations. Thanks, Katharina> On Aug 8, 2009, Katharina May <may.katharina at googlemail.com> wrote: > > Hi there, > > I've got a question which is really trivial for sure but still I have > to ask as I'm not > making any progress solving it by myself (please be patient with an > undergraduate > student): > > I've got a linear model (lm and lmer fitted with method="ML"). > Now I want to compare the coefficients (slope, intercept, not the > random effects) > of both models with a given value (e.g. intercept=0.5, slope=2) to see > if the values > estimated with the models are significantly different from the given values. > > I heard about t.test, but I'm sorry to say that I'm not quite > understanding what I have > to provide as arguments. > > I would be more than happy if somebody can point out an example similar to > the > comparison I have to do... > > Thanks, > > Katharina > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Reasonably Related Threads
- package lmodel2: p-value RMA fitting?
- Problem with plotting diagnostics - Error in object$coefficients : $ operator is invalid for atomic vectors
- Sweave/margin
- Comparing linear regression coefficients to a slope of 1
- Linear Regressions with constraint coefficients