Displaying 20 results from an estimated 2000 matches similar to: "Recommendation on a probability textbook (conditional probability)"
2009 Nov 29
1
optim or nlminb for minimization, which to believe?
I have constructed the function mml2 (below) based on the likelihood function described in the minimal latex I have pasted below for anyone who wants to look at it. This function finds parameter estimates for a basic Rasch (IRT) model. Using the function without the gradient, using either nlminb or optim returns the correct parameter estimates and, in the case of optim, the correct standard
2007 Aug 10
0
half-logit and glm (again)
I know this has been dealt with before on this list, but the previous
messages lacked detail, and I haven't figured it out yet.
The model is:
\x_{ij} = \mu + \alpha_i + \beta_j
\alpha is a random effect (subjects), and \beta is a fixed effect
(condition).
I have a link function:
p_{ij} = .5 + .5( 1 / (1 + exp{ -x_{ij} } ) )
Which is simply a logistic transformed to be between .5 and 1.
2005 Apr 27
0
Fitting a kind of Proportional Odds Modell using nlme, polr, lrm or ordgee
Hello,
I'm trying to fit a special kind of proportional odds model from:
Whitehead et al. (2001). Meta-analysis of ordinal outcome using
individual patient data. Statistics in medicine 20: 2243-2260. (model 2)
The data are as follows:
library(nlme)
library(geepack)
library(Design)
library(MASS)
options(contrasts=c("contr.SAS","contr.poly"))
counts <-
2010 May 18
1
Maximization of quadratic forms
Dear R Help,
I am trying to fit a nonlinear model for a mean function $\mu(Data_i,
\beta)$ for a fixed covariance matrix where $\beta$ and $\mu$ are low-
dimensional. More specifically, for fixed variance-covariance matrices
$\Sigma_{z=0}$ and $\Sigma_{z=1}$ (according to a binary covariate $Z
$), I am trying to minimize:
$\sum_{i=1^n} (Y_i-\mu_(Data_i,\beta))' \Sigma_{z=z_i}^{-1} (Y_i-
2011 Jan 03
1
Greetings. I have a question with mixed beta regression model in nlme.
*Dear R-help:
My name is Rodrigo and I have a question with nlme package
in R to fit a mixed beta regression model. The details of the model are:
Suppose that:*
*j in {1, ..., J}* *(level 1)*
*i in {1, ..., n_j}* *(level 2)*
*y_{ij} ~ Beta(mu_{ij} * phi_{ij}; (1 - mu_{ij}) * phi_{ij})
y_{ij} = mu_{ij} + w_{ij}
*
*with*
*logit(mu_{ij}) = Beta_{0i} + Beta_{1i} * x1_{ij} + b2 * x2_{ij}
2011 Jan 03
0
Greetings. I have a question with mixed beta regression model in nlme (corrected version).
*Dear R-help:
My name is Rodrigo and I have a question with nlme package
in R to fit a mixed beta regression model. I'm so sorry. In the last
email, I forgot to say that W is also a unknown parameter in the mixed
beta regression model. In any case, here I send you the correct formulation.
**
Suppose that:*
*j in {1, ..., J}* *(level 1)*
*i in {1, ..., n_j}* *(level 2)*
*y_{ij} ~
2005 Jun 14
1
within and between subject calculation
Dear helpers in this forum,
I have the following question:
Suppose I have the following data set:
id x y
023 1 2
023 2 5
023 4 6
023 5 7
412 2 5
412 3 4
412 4 6
412 7 9
220 5 7
220 4 8
220 9 8
......
and i want to calculate sum_{i=1}^k
sum_{j=1}^{n_i}x_{ij}*y_{ij}
is there a simple way to do this within and between
subject summation in R?
2005 Jun 15
2
need help on computing double summation
Dear helpers in this forum,
This is a clarified version of my previous
questions in this forum. I really need your generous
help on this issue.
> Suppose I have the following data set:
>
> id x y
> 023 1 2
> 023 2 5
> 023 4 6
> 023 5 7
> 412 2 5
> 412 3 4
> 412 4 6
> 412 7 9
> 220 5 7
> 220 4 8
> 220 9 8
> ......
>
Now I want to compute the
2012 Apr 16
1
eval a SYMSXP from C
Can someone offer some advice on how to properly evaluate a SYMSXP
from a .Call ?
I have the following in R:
variable xn, with an attribute "mu" which references the variable mu
in the global environment.
I know "references" is a loose term; mu was defined in this fashion as
a way to implement deferred binding:
foo <- function(x,mu) {
attr(x,"mu") <-
2008 Aug 29
3
extract variance components
HI,
I would like to extract the variance components estimation in lme function
like
a.fit<-lme(distance~age, data=aaa, random=~day/subject)
There should be three variances \sigma_day, \sigma_{day %in% subject } and
\sigma_e.
I can extract the \sigma_e using something like a.fit$var. However, I cannot
manage to extract the first two variance components. I can only see the
results in
2002 Feb 20
2
How to get the penalized log likelihood from smooth.spline()?
I use smooth.spline(x, y) in package modreg and I would like to get
value of penalized log likelihood and preferable also its two parts. To
make clear what I am asking for (and make sure that I am asking for the
right thing) I clarify my problem trying to use the same notation as in
help(smooth.spline):
I want to find the natural cubic spline f(x) such that
L(f) = \sum_{k=1}{n} w[k](y[k] -
2001 Oct 09
1
PROC MIXED user trying to use (n)lme...
Dear R-users
Coming from a proc mixed (SAS) background I am trying to get into
the use of (n)lme.
In this connection, I have some (presumably stupid) questions
which I am sure someone out there can answer:
1) With proc mixed it is easy to get a hold on the estimated
variance parameters as they can be put out into a SAS data set.
How do I do the same with lme-objects? For example, I can see the
2009 Apr 07
1
typo in R-ints.texi's description of P_ macro
I think there are some missing words in "R Internals"'s description of
the P_ macro.
It currently has "A macro as a wrapper for ngettext", which I think
ought to be
something like "The macro P_ may be used as a wrapper for ngettext".
The following patch also makes the 2 alternate definitions of P_ have
the same argument names,
StringS and StringP. Expanding the
2009 Nov 15
2
lme model specification
Dear all
this is a question of model specification in lme which I'd for which I'd greatly appreciate some guidance.
Suppose I have data in long format
gene treatment rep Y
1 1 1 4.32
1 1 2 4.67
1 1 3 5.09
. . . .
. . . .
. . . .
1 4 1 3.67
1 4 2 4.64
1 4 3 4.87
.
2006 Oct 05
2
Writing Text into Plots
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
I have a simple question on the text() method in plots, e.g.:
text(3,4,adj=1,cex=1.0, expression(alpha == beta))
I know there exists a lot more like frac(), etc which could be used for
expression. But a help(frac) doesn't return any results - where do I
have to look for a documentation of possible text commands?
More in detail I'm
2011 Sep 25
1
Question about syntax in lm function
I encounters some codes in ggplot2 manual and confused with one of its lm syntax. The code is here:
library(ggplot2) d <- subset(diamonds, carat < 2.5 & rbinom(nrow(diamonds), 1, 0.2) == 1) d$lcarat <- log10(d$carat) d$lprice <- log10(d$price) detrend <- lm(lprice ~ lcarat, data = d) d$lprice2 <- resid(detrend) mod <- lm(lprice2 ~ lcarat * color, data = d) # ***
what
2011 Aug 26
1
matrix bands
Dear R developers,
I was looking for a function analogous to base::diag() for getting and
setting bands of a matrix. The closest I could find was Matrix::band(),
but this was not exactly what I wanted for two reasons. Firstly,
Matrix::band() returns a matrix rather than just the specified band.
Secondly, Matrix::band() cannot be used for setting the values for a
matrix band.
Setting or
2004 Nov 23
2
IFELSE across large array?
Dear all,
As our previous email did not get any response, we try again with a
reformulated question!
We are trying to do something which needs an efficient loop over a huge
array, possibly functions such as apply and related (tapply,
lapply...?), but can't really understand syntax and examples in
practice...i.e. cant' make it work.
to be more specific:
we are trying to apply a mask
2006 Sep 14
1
Rv generation
Hi,
Can Someone inform me how to generate RV's using the below CDF, by inverse
technique.
Thanks for your help and time.
My CDF is as follows
\[
F(x)=0 \ \text{if} \ x < 0\]\[
F(x)=\{\frac{x-x_i}{x_{i+1}-x_{i}}*(p_{i+1}-p_{i})\}+p_{i}\
\forall \ x_{i}\leq x < x_{i+1} \]
\[ F(x)=1 \ \text{if} \ x > x_{i+1}
\]
Regards
Murthy
1999 Jan 07
2
math symbols in plot text: 2nd try
Ok, I think my first mail didn't get through so I'll try this again.
Please disregard.
I'm trying to use subscripts on plot text.
The help files say this can be done and give several example.
I'm trying to do: P_{2} (for example) and so I tried:
text(5,2,expression(P_{2}))
which doesn't work. There are no subscript examples. I recall
someone telling me that latex-like