Questions tagged [longitudinal]

Data from studies or processes with multiple observations over time. Econometrics is a typical topic where such data would be collected and analyzed. Proper analysis will take into account auto-correlation and cross-correlation.

262 questions
0
votes
1 answer

Subseting dataframe (long format) based on another dataframe (wide format) in which cases are repeated

I randomly sampled 100 rows from my dataframe (containing 20 rows) in wide format. I used this r code: random_100 <- df.wide[sample(nrow(df.wide), 100, replace = T),] It returns a dataframe containing 100 rows (each with patient-id,…
0
votes
1 answer

Creating an empty longitudinal country dataset

I would like to create an empty longitudinal country-week-dataset in which every country is represented 52 times (weeks of the year) and all other variables are first filled with 0s. It should then look like this: countries = ['Albania', 'Belgium',…
user9092346
  • 292
  • 2
  • 11
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

R vs. SPSS mixed model repeated measures code [from Cross Validated]

NOTE: This question was originally posted on Cross Validated, where it was suggested that it should be asked in StackOverflow instead. I am trying to model a 3-way repeated measures experiment, FixedFactorA * FixedFactorB * Time[days]. There are no…
GH28
  • 135
  • 1
  • 12
0
votes
1 answer

linear mix model on longitudinal data: time as continuous vs unordered factor vs ordered factor

Here I made some longitudinal data. Variable result is biomarker level from patients. Variable visit represent visit labels. Variable time means days from baseline t1. There are two response status, 'yes' and 'no'. What I want to find out is whether…
zesla
  • 11,155
  • 16
  • 82
  • 147
0
votes
1 answer

Interpolate values in unbalanced panel data using SAS

Say we are confined to using SAS and have a panel/longitudinal dataset. We have indicators for cohort and time, as well as some measured variable y. data in; input cohort time y; datalines; 1 1 100 1 2 101 1 3 102 1 4 103 1 5 …
JPErwin
  • 223
  • 1
  • 10
0
votes
1 answer

Recursively advancing a variable by a growth rate variable in SAS

I have a panel/longitudinal dataset in SAS. One field indicates a class or type, another a point in time without breaks, another is the observed history and another is the log difference forecast for said history. I'd like to add a new field: the…
JPErwin
  • 223
  • 1
  • 10
0
votes
1 answer

Group-based trajectory modelling in R

I've been looking for a way to conduct group-based trajectory modeling in R with no avail. Something along the lines of what PROC TRAJ (http://www.andrew.cmu.edu/user/bjones/index.htm) accomplishes in SAS. Does anyone know of a similar package in…
Branners
  • 63
  • 1
  • 9
0
votes
0 answers

Performing mixed model post-hoc tests with longitudinal repeated measures data in R

I recently have been learning how to do mixed models in R (new to both) after being directed to them as a preferred way to analyze my data (originally 2-way repeated measures ANOVA). The study involves EEG recordings of subjects over a period of 6…
Jack
  • 1
  • 2
0
votes
0 answers

How do I Merge two dfs over multiple keys/ emails?

I have two dfs that need to be merged. DF 1 contains 120 rows each with an email. DF2 contains identical emails that are either missing, or duplicated as DF2 is a repeated measures data set where measurement was taken for once a day over a period of…
D500
  • 442
  • 5
  • 17
0
votes
0 answers

SITAR package in R for growth curve analysis

I have the following long dataset (R dataframe called "dat"). It has around 10,000 observations of 1200 children, with a maximum of 10 observations per child. These observations are weight of the child collected at different time points in early…
0
votes
1 answer

Variance Covariance Matrix from Proc GLM

I'm using Proc GLM to fit a basic fixed effects model and I want to get the variance/covariance matrix. I know this is very east to do if you fit a model with proc reg, but the model I'm fitting has a separate slope for each member of a class (over…
RAND
  • 281
  • 2
  • 14
0
votes
0 answers

Modeling longitudinal data with functional coefficients ignoring random effects

I wonder if there is a way to model this following model in SAS (preferably with some built-in functions): Y_{ij} = \beta_{i}(t_{j}) X_{i} + e_{ij}, which basically is a form of functional mixed-effects model without the random-effects parts. Here…
lucy
  • 1
  • 2
0
votes
0 answers

Reshaping data frame from lists to longitudinal data in R

I am trying to reshape the data I have in a data frame for longitudinal analysis. First, here's a reproducible example (albeit not the most elegant one, I am still learning): # reproducible example time <- c(199801, 199802) id <-…
SteffenT
  • 119
  • 6
0
votes
1 answer

incorrect grouping in plotting longitudinal data with ggplot

I was trying to plot my longitudinal dataset with ggplot. Here is the example data to illustrate my problem. library(MASS) library(ggplot2) library(dplyr) # create data dat.tx.a <- mvrnorm(n=250, mu=c(30, 20, 28), …
zesla
  • 11,155
  • 16
  • 82
  • 147