Questions tagged [nlme]

An R package for fitting Non-Linear Mixed Effects statistical models.

An package for fitting Non-Linear Mixed Effects statistical models ().

Repositories

Books

Other resources

Related tags

494 questions
0
votes
0 answers

How do I find out which observations of my dataset have been used for my mlm in R (nlme)?

I have longitudinal data and specified 3 multilevel models for different outcomes with nlme in R. 'model <- lme (...)' They all are based on the same dataset. Now, 'summary(model)' shows me that the observations used for my final three models…
Lynn
  • 13
  • 3
0
votes
0 answers

r mixed model - specify values for fixed effects

Is there a way in nlme or lmer (or any other mixed modeling package in r) to fit a mixed model where the parameter values for the fixed effects are set and only the random effects are fit by the model? I can find documentation explaining how to…
SEGilman
  • 13
  • 5
0
votes
1 answer

R plot marginal effects in lme

I have the following lme model (intercepts random on 3 levels): Y=dependent V., V1-V3=individual level variables (level 1), V4=Country level variable (level 3) random slope for V1 cross-level interaction of V1 and V4 modelCI1= lme(Y~…
0
votes
1 answer

R equivalent to random residual by subject in SAS

I can code this problem in SAS with residual as a random effect ( I believe this is a r-side random intercept by fish) proc glimmix data=one method=mmpl ; class fish; model increment =age growth_year age*growth_year; random residual…
Devon Oliver
  • 295
  • 1
  • 7
  • 20
0
votes
1 answer

How to do a random effect regression with clustered error in R?

I want to calculate the clustered error of regression residuals. I know how to run the random effect model in R. set.seed(50) data <- data.frame(id=rep(1:10,10),income=rnorm(100),education=rnorm(100)) data$id <- factor(data$id) library(nlme) reg <-…
Leonhardt Guass
  • 773
  • 7
  • 24
0
votes
1 answer

How to (properly) specify a cross level effect with lme4/nlme

I'm trying to specify properly a cross level effect with lmer() and lme() functions. I'm working with a modified sleepstudy data version, where I added a level 2 variable: score to each participant: library(lme4) data(sleepstudy) score <- gl(n = 5,…
blazej
  • 1,678
  • 3
  • 19
  • 41
0
votes
0 answers

Error in MEEM(object, conLin, control$niterEM) : Singularity in backsolve at level 0, block 1

I am trying to fit a Linear Mixed Effect model in nlme package. My data…
0
votes
1 answer

How can I produce an estimate for a changing variable using lme4/nlme?

I am fairly new to R and mixed models analysis. I wanted to produce a single estimate for the change in the variable ln_ahr based on time for every individual. I believe this can be thought of as a slope of change in time. Here is how my data is…
guaguncher
  • 77
  • 9
0
votes
1 answer

Extracting input and output variables from nlme result in R

I am trying to automatize plots (fitted vs model input variable, fitted vs model output variable) from models and would like to isolate the input and output variable names from the nlme() results. I managed with something looking like a very dirty…
David
  • 100
  • 1
  • 8
0
votes
0 answers

Generalized randomized block design

I am struggling with the formulation in lme of a generalize randomized block design(GRBD's) with subsampling. The experiment consists of 2 strips, each represents treatment (4years/2years- under crop rotation). Each strip consists of 3 blocks, in…
Bents
  • 23
  • 5
0
votes
0 answers

R - remove p value distortions from spatial auto-correlation in regression using mixed linear models?

I have three questions: What is the problem of spatial-autocorrelation in linear regression? Why can it be resolved by mixed linear models? Is the model implementation below correct? Or do I need to add a correlation structure? I have the…
intasys
  • 75
  • 1
  • 7
0
votes
0 answers

gls does not give correct intercept and slope during multiple regression

Anybody could please tell me why gls function sometimes does not give the correct intercept and slope for a given dataset? Here is a reproducible example: require(nlme) s=read.csv("exampleglsabline.csv") …
Agus camacho
  • 868
  • 2
  • 9
  • 24
0
votes
1 answer

Using custom made weights and structural weight in lme function in R

I am going to use a structural weight like varIndent(from = ~1 |Sex) and a custom made vector of weights called w in lme function in R. So I am wondering if anybody knows how to combine the weights in the function. This is an example (just made for…
MyQ
  • 459
  • 3
  • 13
0
votes
1 answer

set constraints on parameters in gls {name} function

I have the following observations in a matrix M: 30 observations (row) in each of 1 to 5 groups (columns) Reproducible code: Simulate_phase_correction_isochronous<-function(N, nseq, alpha, st, sm) { As<-matrix(NA, nrow=N, ncol=nseq) for(o in…
dom
  • 29
  • 1
  • 4
0
votes
0 answers

Summary function error not from the body of that generic function

I am trying to call the summary function of a model created by the lme function in the nlme package. code and data below. It comes up with the follwing error "call to standardGeneric("summary") apparently not from the body of that generic…
Bikash Deb
  • 55
  • 1
  • 7