A R package to fit aggregated data model.
You can install the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("gabrielfranco89/aggrmodel")
This is a basic example which shows you how to solve a common problem:
library(aggrmodel)
df = simuData
mkt = attr(df, "market")
df = subset(df, cluster==1)
mkt = subset(mkt, group %in% unique(df$group))
aggrFit = aggrmodel(data = df, ## Your data
market = mkt, ## Data market
Y = y, ## Dep. variable
timeVar =time, ## Time variable
groupVar = group, ## Group variable
repVar = rep, ## Replicate variable
n_basis = 7) ## Number of basis functions