Displaying 20 results from an estimated 10000 matches similar to: "variance of a linear model"
2006 Mar 01
0
[Fwd: Re: [R] a strange problem with integrate()]
When I saw the subject of the original message on
R-help, I was 95% confident that I knew the answer
(before I had seen the question).
This made me think that perhaps for some functions
there should be a 'Troubleshooting' section in the help
file.
The current help file for 'integrate' does say, as Sundar
points out, what the requirements are. However, I
think more people would
2006 Mar 01
1
a strange problem with integrate()
Dear all,
I am stuck on the following problem with integrate(). I have been out of
luck using RSiteSearch()..
My function is
g2<-function(b,theta,xi,yi,sigma2){
xi<-cbind(1,xi)
eta<-drop(xi%*%theta)
num<-exp((eta + rep(b,length(eta)))*yi)
den<- 1 + exp(eta + rep(b,length(eta)))
result=(num/den)*exp((-b^2)/sigma2)/sqrt(2*pi*sigma2)
2010 Jul 21
2
Variance of the prediction in the linear regression model (Theory and programming)
Hi, folks,
Here are the codes:
##############
y=1:10
x=c(1:9,1)
lin=lm(log(y)~x) ### log(y) is following Normal distribution
x=5:14
prediction=predict(lin,newdata=x) ##prediction=predict(lin)
###############
1. The codes do not work, and give the error message: Error in
eval(predvars, data, env) :
numeric 'envir' arg not of length one. But if I use the code after the
pound sign, it
2010 Jul 27
0
How to generate variance of a new observation based on a linear regression model
Hi, folks,
x=1:10
y=rep(2:6,2)
lin=lm(y~x)
x=3:12
new=predict(lin,se.fit=T)
#se.fit: the standard error of the predicted means, namely, the square root
of Var( E[y|x] | x)
# How can I generate the variances of the new observations? Namely the
square root of var(y|x),
## Which I think should be much larger than the values from se.fit=T.
The reason why I need to know the estimations of
2008 Sep 25
1
R function which finds confidence interval for binomial variance
I need to construct confidence intervals for the binomial variance.
This is the usual estimate
v = x*(n-x)/n
or its unbiased counterpart
v' = x*(n-x)/(n-1)
where x = binomial number of successes observed in n Bernoulli trials
from proportion p.
The usual X^2 method for variance confidence intervals will not work,
because of the strong non-normal character of the sampling
2008 Apr 10
0
how to fit a model that is nonlinear with multiplicate errors
Hi fellow R-users,
I am interested in fitting the following model
yi=log(a+xi*b*e), e~N(0,sigma2)
and where x is a known covariate and a and b are parameters to be estimated as is sigma2.
I am not sure how to fit such a model using lm or nls. Is there another function I can use to fit this?
Thanks for any help.
Stacey
---------------------------------
[[alternative HTML version
2007 Sep 04
1
Robust linear models and unequal variance
Hi all,
I have probably a basic question, but I can't seem to find the answer in
the literature or in the R-archives.
I would like to do a robust ANCOVA (using either rlm or lmRob of the
MASS and robust packages) - my response variable deviates slightly from
normal and I have some "outliers". The data consist of 2 factor
variables and 3-5 covariates (fdepending on the model).
2011 Mar 28
1
maximum likelihood accuracy - comparison with Stata
Hi everyone,
I am looking to do some manual maximum likelihood estimation in R. I
have done a lot of work in Stata and so I have been using output
comparisons to get a handle on what is happening.
I estimated a simple linear model in R with lm() and also my own
maximum likelihood program. I then compared the output with Stata.
Two things jumped out at me.
Firstly, in Stata my coefficient
2006 Oct 12
2
how to get the variance-covariance matrix/information of alpha and beta after fitting a GLMs?
Dear friends,
After fitting a generalized linear models ,i hope to get the variance of
alpha,variance of beta and their covariance, that is , the
variance-covariance matrix/information of alpha and beta , suppose *B* is
the object of GLMs, i use attributes(B) to look for the options ,but can't
find it, anybody knows how to get it?
> attributes(B)
$names
[1] "coefficients"
2012 Jul 12
0
HAR-RV-CJ Moedel
I am trying to write a loop to forecast realized volatility over successive
days for the purpose of VaR prediction using the HAR-RV-CJ model which is as
follows:
log(RV_t+1) = ?_0 + ?_CD log(CV_t) + ?_CW log(CV_t-5) + ?_CM
log(CV_t-22) + ?_JD log(J_t + 1) + ?_JW log(J_t-5 + 1) + ?_JM log(J_t-22 +
1) + e_t
where RV is realized volatility, CV is continuous volatility and J is the
jump which is
2011 Oct 24
0
Output from BRugs Doesn't Match That from OpenBUGS
Hi.
I am trying to analyze with BRugs the Box-Tiao variance components example
in WinBUGS. The output from BRugs,
mean sd MC_error val2.5pc median val97.5pc start sample
sigma2.btw 681.9 1161 10.89 0.7016 253.8 4232 25001 100000
sigma2.with 4266.0 1246 4.92 2480.0000 4057.0 7262 25001 100000
doesn't match the output from WinBUGS,
node mean
2007 Sep 22
0
How to explain the meaning of mu in the variance function of GLMs?
Dear R friends,
When fitting GLMs in R, we may need to specify the variance function to do
our analysis. I had thought it's the mean value, but it seems not. Could
anybody expain the correct meaning of *mu* in the variance function of
GLMs? The following content is from the R-hlep.
variance for all families other than quasi, the variance function is
determined by the family. The quasi
2008 Feb 03
1
Effect size of comparison of two levels of a factor in multiple linear regression
Dear R users,
I have a linear model of the kind
outcome ~ treatment + covariate
where 'treatment' is a factor with three levels ("0", "1", and "2"),
and the covariate is continuous. Treatments "1" and "2" both have
regression coefficients significantly different from 0 when using
treatment contrasts with treatment "0" as the
2006 Jul 07
2
Multistage Sampling
Dear WizaRds, dear Thomas,
First of all, I want to tell you how grateful I am for all your
support. I wish I will be able to help others along one day the same way
you do. Thank you so much. I am struggling with a multistage sampling
design:
library(survey)
multi3 <- data.frame(cluster=c(1,1,1,1 ,2,2,2, 3,3), id=c(1,2,3,4,
1,2,3, 1,2),
nl=c(4,4,4,4, 3,3,3, 2,2), Nl=c(100,100,100,100,
2005 Jun 06
1
A performance anomaly
I wrote a simple log likelihood (for the ordinary least squares (OLS)
model), in two ways. The first works out the likelihood. The second
merely calls the first, but after transforming the variance parameter,
so as to allow an unconstrained maximisation. So the second suffers a
slight cost for one exp() and then it pays the cost of calling the first.
I did performance measurement. One would
2017 Jun 12
0
issues in plm using random effect model
Dear Kailas Gokhale,
The negative individual variance is not a problem with your code or plm.
It a property of your data. Please check the posts of Giovanni Millo on
this topic:
[R] R: plm random effect: the estimated variance of the individual
effect is negative
Millo Giovanni Giovanni_Millo at Generali.com
Sat Jan 5 10:10:01 CET 2013
You can find the posts in the archive by rseek.org.
2010 Jun 22
2
Verify the linear regression model used in R ( fundamental theory)
Hi, folks,
As I understand, Least-squares Estimate (second-moment assumption) and the
Method of Maximum Likelihood (full distribtuion assumption) are used for
linear regression.
I do >?lm, but the help file does not tell me the model employed in R. But
in the book 'Introductory Statistics with R', it indicates R estimate the
parameters using the method of Least-squares. However it
2005 May 23
3
skewness and kurtosis in e1071 correct?
I wonder whether the functions for skewness and kurtosis in the e1071
package are based on correct formulas.
The functions in the package e1071 are:
# --------------------------------------------
skewness <- function (x, na.rm = FALSE)
{
if (na.rm)
x <- x[!is.na(x)]
sum((x - mean(x))^3)/(length(x) * sd(x)^3)
}
# --------------------------------------------
and
#
2012 Jul 03
0
need help EM algorithm to find MLE of coeff in mixed effects model
Dear All,
have a general question about coefficients estimation of the mixed model.
I simulated a very basic model: Y|b=X*\beta+Z*b +\sigma^2* diag(ni);
b follows
N(0,\psi) #i.e. bivariate normal
where b is the latent variable, Z and X are ni*2 design matrices, sigma is
the error variance,
Y are longitudinal data, i.e. there are ni
2004 Jun 09
1
Re: R equivalent of Splus rowVars function
Mark Leeds <mleeds at mlp.com> wrote (to S-News):
> does anyone know the R equivalent of the SPlus rowVars function ?
Andy Liaw <andy_liaw at merck.com> replied:
> More seriously, I seem to recall David Brahms at one time had created an R
> package with these dimensional summary statistics, using C code. (And I
> pointed him to the `two-pass' algorithm for variance.)