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
2 answers

how to manipulated data set into new data frame?

my data look like this : 1-pre 2-mid 3-post id<-c(1,2,3,4,5,6,7,8,9) type<-c(1,2,2,1,2,1,1,1,2) #is the factor level 1 and…
user10569803
0
votes
1 answer

Defining episodes in longitudinal data

I have a dataset, in which I would like to define 'episodes'. An episode is defined if there is an increase or decrease of temperature for at least 15 minutes. Is there any way to structure this without doing it manually? This is the structure of…
0
votes
1 answer

Variable screening continuous outcomes, categorical predictor, negative p-values

I'm trying to find a good set of variables for classification using a large dataset of expression data (all categorical variables along the columns) to predict a binary outcome. Each subject is measured at several, but not all timepoints (T1-T7 in…
0
votes
1 answer

Analyze Repeated Measures Data Using PROC GLIMMIX

I am using PROC GLIMMIX to analyze repeated measures data about specific sexual events. The original data came from a weekly diary study of about 400 people. During each week they reported on behaviours from their most recent sexual encounter. We…
Kiffer Card
  • 13
  • 1
  • 6
0
votes
1 answer

Subsetting a longitudinal dataset by more than one variable in R

I have a longitudinal dataset in long-form, with (among others) the variables: ID, wave, currently working, occurance of chronic disease and self rated health: ID wave working Chronic SRH 451101001003 1997 1 0 …
0
votes
1 answer

r merging 2 data frames that have both common and unique variables into long data

Not sure if my title conveys my question well. It will make more sense if you could read this example. I'd like to merge 2 data frames that are 2-wave longitudinal survey. Time1 data frame has more participants than Time2 data frame as not everyone…
ffew
  • 15
  • 4
0
votes
1 answer

Keep first record when event occurrs

I have the following data in Stata: clear * Input data input grade id exit time 1 1 . 10 2 1 . 20 3 1 2 30 4 1 0 40 5 1 . 50 1 2 0 10 2 2 0 20 3 2 0 30 4 2 0 40 5 2 0 50 1 3 1 10 2 …
bvowe
  • 3,004
  • 3
  • 16
  • 33
0
votes
1 answer

Convert multi-stage event data to longitudinal data in r

I have a data set on job promotions. For each person, I have the exact data on when they were hired by the company, promoted, and left the company. I also have a few characteristics. I am using r. SubjectID Entry Stage1 Stage2 Stage3 …
0
votes
0 answers

How to keep imputed value constant over time using R package Amelia?

I have data from longitudinal study about BMI and other variables (that could have some effect on BMI) in children in different time points, and I want to impute missing values using function amelia() from R package Amelia. Each variable has at…
user8013413
0
votes
1 answer

Fast way to compute weighted group-wise means in R?

Given longitudinal data, how can I compute a matrix where each column represents the weighted group-wise mean of a given variable? I've developed an approach that requires a loop, and it's too slow. I think that this could probably be vectorized,…
generic_user
  • 3,430
  • 3
  • 32
  • 56
0
votes
1 answer

Can group by and tidy be used to fit multilevel models (lme) to repeated measures/longitudinal data?

Consider the following example longitudinal/repeated measures dataset library(tidyverse) library(broom) library(nlme) data <- read.csv("https://stats.idre.ucla.edu/stat/data/study2.csv") data <- data %>% mutate(dbp =rnorm(120, 30:150), sbp =…
aelhak
  • 441
  • 4
  • 14
0
votes
1 answer

How to create a rank for a variable in a longitudinal dataset based on a condition?

I have a longitudinal dataset where each subject is represented more than once. One represents one admission for a patient. Each admission, regardless of the subject also has a unique "key". I need to figure out which admission is the "INDEX"…
0
votes
1 answer

Plot predicted values from lmer longitudinal analysis

I'm analyzing some longitudinal data using lme4 package (lmer function) with 3 Levels: measurement points nested in individuals nested in households. I'm interested in linear and non-linear change curves surrounding a specific life event. My model…
Marie B.
  • 119
  • 1
  • 7
0
votes
1 answer

How to count subjects on a longitudinal patient study in R?

I have a database with multiple patient visits, like 1 1 1 1 2 2 3 3 3 3 4 4 4 4 They are in a column (although here are shown in a row) and I would like to know how to count how many subjects do I have. Like in this case: 4 I don't know which code…
Lili
  • 547
  • 6
  • 19
0
votes
0 answers

Indefinite matrix warning in panel regression

I am using the lfe package to estimate a panel regression model where conversion is a binary variable. I know that ultimately logistic regression should be used, however, a professor suggested using linear regression first as an estimate of the…
abu
  • 737
  • 5
  • 8
  • 19