Displaying 20 results from an estimated 7000 matches similar to: "[OT] good reference for mixed models and EM algorithm"
2006 Aug 10
5
Variance Components in R
Hi,
I'm trying to fit a model using variance components in R, but if very
new on it, so I'm asking for your help.
I have imported the SPSS database onto R, but I don't know how to
convert the commands... the SPSS commands I'm trying to convert are:
VARCOMP
RATING BY CHAIN SECTOR RESP ASPECT ITEM
/RANDOM = CHAIN SECTOR RESP ASPECT ITEM
/METHOD = MINQUE (1)
/DESIGN
2006 Aug 14
1
ARMA(1,1) for panel data
Dear List,
I am new to TS-Modeling in R. I would like to fit an ARMA(1,1) model
for a balanced panel, running Y on a full set of unit and year dummies
using an arma(1,1) for the disturbance:
y_it=unit.dummies+yeardummies+e_it
where: e_it=d*e_it-1+u_it+q*u_it-1
How can I fit this model in R? arma() does not seem to take covariates
(or I don't understand how to specify the function so that
2006 Aug 03
3
between-within anova: aov and lme
I have 2 questions on ANOVA with 1 between subjects factor and 2 within factors.
1. I am confused on how to do the analysis with aov because I have seen two examples
on the web with different solutions.
a) Jon Baron (http://www.psych.upenn.edu/~baron/rpsych/rpsych.html) does
6.8.5 Example 5: Stevens pp. 468 - 474 (one between, two within)
between: gp
within: drug, dose
aov(effect ~ gp * drug *
2006 Jun 05
1
Extracting Variance components
I can ask my question using and example from Chapter 1 of Pinheiro & Bates.
> # 1.4 An Analysis of Covariance Model
>
> OrthoFem <- Orthodont[ Orthodont$Sex == "Female", ]
> fm1OrthF <-
+ lme( distance ~ age, data = OrthoFem, random = ~ 1 | Subject )
> summary( fm1OrthF )
Linear mixed-effects model fit by REML
Data: OrthoFem
AIC BIC
2010 Jul 27
4
Sweave and scan()
I am introducing the scan() function to my class. Consider the following
file (Scanexamp.Rnw )
\documentclass[12pt]{article}
\begin{document}
<<>>=
height = scan()
64 62 66 65 62
69 72 72 70
part = scan(what = character(0))
"Soprano" "Soprano" "Soprano"
"Alto" "Alto" "Tenor"
"Tenor" "Bass"
2003 Sep 17
3
More files randomly corrupted
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Still having that problem with samba seemingly corrupting files, it seems to be the same files that are corrupted again and again, yet they are corrupted differently and sometimes not. I ran my md5 summer against one file ch02.pdf, and it almost contineously corrupts, I checked in a hex editor and there are some differences. Yet the problem is that
2008 Jun 14
1
"False convergence" in LME
I tried to use LME (on a fairly large dataset, so I am not including it), and I got this error message:
Error in lme.formula(formula(paste(c(toString(TargetName), "as.factor(nodeInd)"), :
nlminb problem, convergence error code = 1
message = false convergence (8)
Is there any way to get more information or to get the potentially wrong estimates from LME?
(Also, the page in the
2006 Nov 23
1
lme function
Hello.
As advised by Mick Crawley in his book on S+, I'm trying to use the lme
function to examine a linear relationship between two variables measured at
60 locations in 12 sites, while taking account of any spatial
autocorrelation (i.e. similarity in variation between the two variables that
is due to site). I am using the function as follows:
2008 Mar 07
2
Irregular Time Series Issue
Hello,
I have an irregular time series of the form :
Time Data Time1 Data1 ....
1 b 1 e
7 g 4 i
NA NA 5 k
NA NA NA NA ...
(the columns have varying length of NAs after a certain point)
Converting this to regular time series with Pastecs does not seem to
work, when I see the
entire data as a single series. So I remove
2006 Apr 14
5
vector-factor operation
I found myself wanting to average a vector [vec] within each level of a
factor [Fac], returning a vector of the same length as vec. After a
while I realised that
lm1 <- lm(vec ~ Fac)
fitted(lm1)
did what I want.
But there must be another way to do this, and it would be good to be
able to apply other functions than mean() in this way.
Cheers, Murray
--
Dr Murray Jorgensen
2006 Nov 22
1
problem with the plm package (2)
Thanks a lot for the quick answerd I received and that helped me to
solve my first (simple) problem with the plm package.
Unfortunatley, here's another one:
I do not know why, but I'm unable to estimate a simple model in the
form y ~ 1 + x
When I try
> zz <- plm(y ~ 1 + x , data=mydata)
I obtain
Errore in X.m[, coef.within, drop = F] : numero di dimensioni errato
which means
2009 Mar 17
1
Putting demo shell scripts, text files, and RScript files with a package?
I've written a package to assist with using R in Hadoop Streaming.
The main point of the package is to help make command-line runnable
RScript files. I'd like to provide a demo RScript file, a demo data
file (e.g. a plaintext file, not something already processed by R) ,
as well as demo bash shell scripts that demonstrate how to run the job
from the command line and in a Hadoop
2006 Aug 02
1
unbalanced mixed effects models for fully factorial designs
Does anyone know of a way of dealing with unbalanced mixed effects
(fixed and random factors) for fully factorial designs.
An example of such data is given below;
The response variable is SQRTRECRUITS
SEASON is a random factor
DENSITY is a fixed factor
Thus DENSITY:SEASON is a fixed factor.
Therefore, whereas the effects of SEASON and DENSITY:SEASON should be
tested against the overall
2011 Jan 05
4
Converting Fortran or C++ etc to R
I'm going to try my hand at converting some Fortran programs to R. Does
anyone know of any good articles giving hints at such tasks? I will post
a selective summary of my gleanings.
Cheers, Murray
--
Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at waikato.ac.nz
2006 Nov 13
2
A printing "macro"
I am exploring the result of clustering a large multivariate data set
into a number of groups, represented, say, by a factor G.
I wrote a function to see how categorical variables vary between groups:
> ddisp <- function(dvar) {
+ csqt <- chisq.test(G,dvar)
+ print(csqt$statistic)
+ print(csqt$observed)
+ print(round(csqt$expected))
+ round(csqt$residuals)
+ }
>
> x
2007 Dec 05
2
Dimension of a vector
Consider the following:
> A <- 1:10
> A
[1] 1 2 3 4 5 6 7 8 9 10
> dim(A)
NULL
> dim(A) <- c(2,5)
> A
[,1] [,2] [,3] [,4] [,5]
[1,] 1 3 5 7 9
[2,] 2 4 6 8 10
> dim(A)
[1] 2 5
> dim(A) <- 10
> A
[1] 1 2 3 4 5 6 7 8 9 10
> dim(A)
[1] 10
Would it not make sense to have dim(A) = length(A) for all vectors?
2006 Jun 19
2
Nested variance-covariance matrix in Multilevel model
Dear R community,
I have trouble implementing a nested variance-covariance matrix in the
lme function.
The model has two fixed effects called End and logpgc, the response
variable is the logarithm to base 2 of Intensity ( log2(Intensity) )
and the random effects are called Probe and ProbeNo.
The model has the following nesting structure: A Pixel is nested within
the ProbeNo,the ProbeNo is
2006 Nov 14
3
lpSolve and mixed signs
Hi R People:
If you have a linear programming problem in which
some of the constraints have the "<=", some
have ">=" and some have "=", all in the same problem,
should the solver work?
I'm having trouble with that. Any help much appreciated!
Sincerely,
Erin Hodgess
mailto: hodgess at gator.uhd.eud
whoops!
mailto: hodgess at gator.uhd.edu
2006 Jun 08
2
nested mixed-effect model: variance components
Dear listers,
I am trying to assess variance components for a nested, mixed-effects
model. I think I got an answer that make sense from R, but I have a
warning message and I wanted to check that what I am looking at is
actually what I need:
my data are organized as transects within stations, stations within
habitats, habitats within lagoons.
lagoons: random, habitats: fixed
the question is:
2008 Aug 26
2
lattice plotting character woes
The following reproducable code shows the setting of my problem:
set.seed(260808)
n = 50
x = rnorm(n)
y = rnorm(n)
z = ceiling(runif(n,0,4))
g = runif(n,0,6)
G = factor(ceiling(g))
xyplot(y ~ x | G)
plsy <- trellis.par.get("plot.symbol")
plsy$pch = z
trellis.par.set("plot.symbol",plsy)
xyplot(y ~ x | G)
plsy$pch = as.character(z)