Displaying 20 results from an estimated 10000 matches similar to: "package for measurement error models"
2008 Sep 11
0
Loop for the convergence of shape parameter
Hello,
The likelihood includes two parameters to be estimated: lambda
(=beta0+beta1*x) and alpha. The algorithm for the estimation is as
following:
1) with alpha=0, estimate lambda (estimate beta0 and beta1 via GLM)
2) with lambda, estimate alpha via ML estimation
3) with updataed alpha, replicate 1) and 2) until alpha is converged to a
value
I coded 1) and 2) (it works), but faced some
2005 Dec 01
2
Minimizing a Function with three Parameters
Hi,
I'm trying to get maximum likelihood estimates of \alpha, \beta_0 and
\beta_1, this can be achieved by solving the following three equations:
n / \alpha + \sum\limits_{i=1}^{n} ln(\psihat(i)) -
\sum\limits_{i=1}^{n} ( ln(x_i + \psihat(i)) ) = 0
\alpha \sum\limits_{i=1}^{n} 1/(psihat(i)) - (\alpha+1)
\sum\limits_{i=1}^{n} ( 1 / (x_i + \psihat(i)) ) = 0
\alpha \sum\limits_{i=1}^{n} (
2010 Mar 25
0
help with breaking loops used to fit covariates in nlme model building procedure
Dear All
I'm attempting to speed up my model building procedure, but need some help with the loops I've created...please bear with me through the explanation!
My basic model call is something like:
m0sulf.nlme<-nlme(conc~beta0*exp(-beta1*day)+beta2*exp(-beta3*day),
data=m0sulf,
fixed=(beta0+beta1+beta2+beta3~1),
2008 Jan 28
2
Package simex
Dear R-helpers,
It is not clear to me how you get measurement.error SD when you have a
single dataset, and it is not clear to me how sensitive SIMEX is to
errors in the estimates of measurement error.
Could someone please point me to the relevant literature?
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400
2011 May 04
1
hurdle, simulated power
Hi all--
We are planning an intervention study for adolescent alcohol use, and I
am planning to use simulations based on a hurdle model (using the
hurdle() function in package pscl) for sample size estimation.
The simulation code and power code are below -- note that at the moment
the "power" code is just returning the coefficients, as something isn't
working quite right.
The
2008 Sep 12
1
Error in "[<-"(`*tmp*`, i, value = numeric(0)) :
I use "while" loop but it produces an errro. I have no idea about this.
Error in "[<-"(`*tmp*`, i, value = numeric(0)) :
nothing to replace with
The problem description is
The likelihood includes two parameters to be estimated: lambda
(=beta0+beta1*x) and alpha. The algorithm for the estimation is as
following:
1) with alpha=0, estimate lambda (estimate beta0
2007 May 14
1
Hierarchical models in R
Is there a way to do hierarchical (bayesian) logistic regression in R, the
way we do it in BUGS? For example in BUGS we can have this model:
model
{for(i in 1:N) {
y[i] ~ dbin(p[i],n[i])
logit(p[i]) <- beta0+beta1*x1[i]+beta2*x2[i]+beta3*x3[i]
}
sd ~ dunif(0,10)
tau <- pow(sd, -2)
beta0 ~ dnorm(0,0.1)
beta1 ~ dnorm(0,tau)
beta2 ~ dnorm(0,tau)
beta3 ~
2011 Apr 19
1
How to Extract Information from SIMEX Output
Below is a SIMEX object that was generated with the "simex" function from the
"simex" package applied to a logistic regression fit. From this mountain of
information I would like to extract all of the values summarized in this
line:
.. ..$ variance.jackknife: num [1:5, 1:4] 1.684 1.144 0.85 0.624 0.519 ...
Can someone suggest how to go about doing this? I can extract the
2007 Dec 04
1
Metropolis-Hastings within Gibbs coding error
Dear list,
After running for a while, it crashes and gives the following error message: can anybody suggest how to deal with this?
Error in if (ratio0[i] < log(runif(1))) { :
missing value where TRUE/FALSE needed
################### original program ########
p2 <- function (Nsim=1000){
x<- c(0.301,0,-0.301,-0.602,-0.903,-1.208, -1.309,-1.807,-2.108,-2.71) # logdose
2012 Dec 04
1
Winbugs from R
Hi,
I am trying to covert a Winbugs code into R code. Here is the winbugs code
model{# model’s likelihoodfor (i in 1:n){time[i] ~ dnorm( mu[i], tau ) # stochastic componenent# link and linear predictormu[i] <- beta0 + beta1 * cases[i] + beta2 * distance[i]}# prior distributionstau ~ dgamma( 0.01, 0.01 )beta0 ~ dnorm( 0.0, 1.0E-4)beta1 ~ dnorm( 0.0, 1.0E-4)beta2 ~ dnorm( 0.0, 1.0E-4)#
2013 Jan 18
0
problem that arises after using the new version of "BRugs"
Respected Sir,
With reference to my mail to you and the reply mail
by you dated 9th and 16th January, 2013, I am sending the reproducible code
in the attached document named " MODIFIED ANS ". I am also attaching the
txt file named "hazModel", which is required to save in my documents folder
to run the program. The file also contains the error message
2004 May 24
0
Seasonal ARIMA question - stat package (formerly ts)
To whom it may concern:
I am trying to better understand the functionality of 'R' when making
arima predictions to avoid any "Black Box" disadvantages.
I'm fitting a seasonal arima model using the following command (having
already loaded 'stat' package).
arimaSeason <-
arima(Data,order=c(1,0,1),seasonal=list(order=c(1,0,1),period=12))
I can then generate
2012 Oct 03
1
Errors when saving output from WinBUGS to R
Dear all
I used R2WinBUGS package's bugs() function to generate MCMC results. Then I
tried to save the simulation draws in R, using read.bugs() function. Here is
a simple test:
######################
library(coda)
library(R2WinBUGS)
#fake some data to test
beta0=1
beta1=1.5
beta2=-1
beta3=2
N=200
x1=rnorm(N, mean=0,sd=1)
x2=rnorm(N, mean=0,sd=1)
x3=rnorm(N, mean=0,sd=1)
lambda2= exp(beta0+
2003 Jun 26
1
Residual plotting
Dear all,
So far i could do (in an informal way) to draw a Standardized Resisual plot
in the following way-
---------------------
>x <- c(104.1, 106.6, 105.5, 107.5, 109.6, 113.3, 115.5, 117.7, 119.9,
122.1, 124.3, 126.5, 128.2)
>y <- c(53732, 52912, 57005, 61354, 67682, 71602, 71961, 75309, 82931,
93310, 102161, 103068, 108927)
>
2012 Jul 02
1
How to get prediction for a variable in WinBUGS?
Dear all,I am a new user of WinBUGS and need your help. After running the following code, I got parameters of beta0 through beta4 (stats, density), but I don't know how to get the prediction of the last value of h, the variable I set to NA and want to model it using the following code.Does anyone can given me a hint? Any advice would be greatly appreciated.Best
2012 May 27
7
Customized R Regression Output?
Hello R-Experts,
I am facing the problem that I have to estimate several parameters for a lot
of different dependent variables.
One single regression looks something like this:
y = beta0 + beta1 * x1 + beta2 * x2 + beta3 * x1 * x2 + beta4 * x4 + beta5 *
lag(x4,-1)
where y is the dependent variable and xi are the independent ones. Important
to me are the different estimates of betai and their
2012 Aug 07
6
Decimal number
HI
>i have a little problem please help me to solve it
>this is the code in R:
>> beta0
[1] 64.90614
> beta1
[1] 17.7025
> beta
[1] 17 64
>her beta<- c(beta0, beta1)
thank you in advance
hafida
--
View this message in context: http://r.789695.n4.nabble.com/Decimal-number-tp4639428.html
Sent from the R help mailing list archive at Nabble.com.
2009 Sep 28
1
Using linear formula inside MLE
Say I have a formula Y ~ 1 + X, where X is a categorical variable. A
previous thread showed how to evaluate this model using the mle package
from "stats4" (see below). But, the user had to create the data matrix,
X, including the column of one's for the regression constant. Is there a
way to nest the linear formula in the code below, so the data matrix
doesn't explicitly
2010 Jun 23
1
Estimate of variance and prediction for multiple linear regression
Hi, everyone,
Night. I have three questions about multiple linear regression in R.
Q1:
y=rnorm(10,mean=5)
x1=rnorm(10,mean=2)
x2=rnorm(10)
lin=lm(y~x1+x2)
summary(lin)
## In the summary, 'Residual standard error: 1.017 on 7 degrees of freedom',
1.017 is the estimate of the constance variance?
Q2:
beta0=lin$coefficients[1]
beta1=lin$coefficients[2]
beta2=lin$coefficients[3]
2009 Nov 05
1
Simulate data for spline/piecewise regression model
Dear All,
I am trying to simulate data for a spline/piecewise regression model. I am missing something fundamental in my simulation procedure because when I try to fit my simulated data using the Gauss-Newton method in SAS, I am getting some wacky parameter estimates. Can anyone please check my simulation code and tell me what mistake I am making in generating data for spline model?
Thank you