Skip to content
Prev 269298 / 398502 Next

Calculating p-value for 1-tailed test in a linear model

It's not that it's known to be false, rather it's not of interest in this
case.  If animal density (response) decreases with increasing year
(predictor), then a change in land management practices might be needed.
Whereas, if animal density is increasing, then the status quo should
suffice.  Decision makers might decide they only need to know if density is
decreasing so that management actions can be taken to mitigate the problem.

Mark's message:
Hi: jake the value of beta_ j hat ( whatever the coefficient is from the
output ) along with the standard deviation of that coefficient , sigma_ j
hat.

Then, if you want to test the alternative that beta is greater than zero,
then calculate

t* = (beta _j - 0)/sigma_j

and 1-pt(t*, df) will give you the p-value.

the only slightly tricky part tricky part is getting sigma_j hat. If you
take the summary of the lm and call it summlm. then take diag(summlm$cov)
and then the sigma_ j hat that you want is depends on which coefficient you
want to test. if you want the third coefficient, then take the third one
etc.

       mark

p.s: you could also divide the two tailed pvalue that have by 2 and that
will give you the right answer also but it doesn't show the understanding.

-----Original Message-----
From: David Winsemius [mailto:dwinsemius at comcast.net] 
Sent: Monday, August 22, 2011 9:12 AM
To: Andrew Campomizzi
Cc: r-help at r-project.org
Subject: Re: [R] Calculating p-value for 1-tailed test in a linear model
On Aug 22, 2011, at 9:44 AM, Andrew Campomizzi wrote:

            
So the possibility that the response variable will be increased by the  
predictor variable is known to be false? It would be unusual to have  
such prior knowledge but I suppose it is possible if the starting  
point is at the ceiling, but then typical regression methods may not  
be appropriate.
Mark's response was not copied to the list.