Growth curve analysis
statist7 / sitar Goto Github PK
View Code? Open in Web Editor NEWGrowth curve analysis
Growth curve analysis
Hi,
If age is in weeks when using sitar, when I look at the fixed.effects(model) output, do I need to do anyting special to interpret the a and c fixed effects? For example I fit the the following model:
mwei_heu <- sitar(x = weeks, y = weight_kg, id = ptid, data = data_long_heu, df = 3, random = "a + c")
and the fixed effect 'a' = 7.07 and 'c' = 1.01 which don't quite make sense given age as weeks. I am asking because I want to present the numeric overall 'a' and 'c' parameters along with standard deviations.
Could you tell me about how to set or get the individal's three parameter in SITAR fomular in reality: Size, timing and intensity? I want to use this model to estimate individual's height growth curves in reality!
Thanks a lot!
Hi,
I have height data with at least 5 subjects per age bin (ranging 8-13 in half year increments). People have multiple height measures every few months so I reduced it down to 1 height measure per person per half year age bin. Sitar seems to run for a and b parameters but not c. And it definitely doesn't run if I leave age continuous (e.g., 8.46) with several height measures per person. What could be causing this? I am re-estimating sitar values for a slightly smaller subset of people from a dataset wherein people already ran sitar successfully. I tried dfs of 3,4,5, and 6 to no avail.
Hello,
I am trying to run the following simple model before more complexity:
model <- sitar(x = age, y = logT, id = id, data = hormonedata, df = 3)
where lotT = log of testosterone. The data do not have any NA's for this model, though when I log transformed there were some negative values. However, I keep getting errors such as "Error in nlme.formula(y ~ fitnlme(x, a, b, c, s1, s2, s3), fixed = s1 + :
Singularity in backsolve at level 0, block 1"
Or convergence issues. I am wondering if you can help? Are there any sitar examples using hormone data?
Much appreciated!!
My team at MPI-EVA recently transcribed the data from Tuddenham, Read D. and Snyder, Margaret M. (1954), aka berkeley.rda
, before realizing it was already done in this package! Comparing the two transcriptions, we spotted a few small typos which are worth correcting.
id | age | variable | sitar | book |
---|---|---|---|---|
207 | 0.25 | weight | 8.5 | 6.5 |
208 | 1.75 | weight | 13.5 | 13.9 |
221 | 12 | weight | 41.3 | 47.3 |
227 | 3 | weight | 14.1 | 14.7 |
258 | 3 | weight | 16.1 | 16.7 |
269 | 2 | weight | 11.2 | 12.2 |
274 | 11.5 | weight | 31.0 | 37.0 |
317 | 18.0 | weight | 54.1 | 54.7 |
364 | 13.0 | weight | 35.5 | 35.9 |
369 | 11.0 | weight | 35.0 | 39.0 |
And these for height:
id | age | variable | sitar | book |
---|---|---|---|---|
203 | 15.50 | height | 165.7 | 168.7 |
225 | 12.50 | height | 154.1 | 154.4 |
238 | 0.25 | height | 60.3 | 60.8 |
276 | 0.75 | height | 72.1 | 72.4 |
277 | 1.50 | height | 82.1 | 82.4 |
307 | 1.75 | height | 85.0 | 88.0 |
325 | 0.75 | height | 67.4 | 67.1 |
325 | 18.50 | height | 156.1 | 156.4 |
383 | 18.50 | height | 162.5 | 162.8 |
We are not including the following "errors", which are clearly corrections on your part from what must have been mistakes when they first prepared these tables in 1954.
id | age | variable | sitar | book |
---|---|---|---|---|
201 | 16.50 | height | 177.2 | 172.2 |
304 | 5.00 | height | 113.9 | 103.9 |
325 | 3.00 | height | 88.8 | 83.8 |
Prepare for release:
git pull
urlchecker::url_check()
devtools::check(remote = TRUE, manual = TRUE)
devtools::check_win_devel()
rhub::check_for_cran()
revdepcheck::revdep_check(num_workers = 4)
cran-comments.md
git push
Submit to CRAN:
usethis::use_version('minor')
devtools::submit_cran()
Wait for CRAN...
git push
usethis::use_github_release()
usethis::use_dev_version()
usethis::use_news_md()
git push
Hi,
I am sorry if this is a stupid question I am relatively new to Rstudio and github.
I have tried installing the sitar
package but whenever i try to load it from the library it says : Error in library(sitar) : there is no package called ‘sitar`.
There are various errors which I have tried to remedy that appear during the instillation process. I have tried the following.
I don't feel it is a more general error because other packages are downloading and running fine. Has anyone else experienced this or what would next steps be?
The full instillation text is below:
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Niall Macsweeney/OneDrive/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
also installing the dependencies ‘rlang’, ‘tibble’, ‘vctrs’, ‘dplyr’, ‘rsample’
There are binary versions available but the source versions are later:
binary source needs_compilation
rlang 1.1.0 1.1.2 TRUE
vctrs 0.6.1 0.6.4 TRUE
dplyr 1.1.2 1.1.4 TRUE
rsample 1.1.1 1.2.0 FALSE
sitar 1.3.0 1.4.0 FALSE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/rlang_1.1.0.zip'
Content type 'application/zip' length 1710397 bytes (1.6 MB)
downloaded 1.6 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/tibble_3.2.1.zip'
Content type 'application/zip' length 702025 bytes (685 KB)
downloaded 685 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/vctrs_0.6.1.zip'
Content type 'application/zip' length 1581321 bytes (1.5 MB)
downloaded 1.5 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/dplyr_1.1.2.zip'
Content type 'application/zip' length 1646641 bytes (1.6 MB)
downloaded 1.6 MB
package ‘rlang’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘rlang’
Warning in install.packages :
problem copying C:\Users\Niall Macsweeney\OneDrive\Documents\R\win-library\4.1\00LOCK\rlang\libs\x64\rlang.dll to C:\Users\Niall Macsweeney\OneDrive\Documents\R\win-library\4.1\rlang\libs\x64\rlang.dll: Permission denied
Warning in install.packages :
restored ‘rlang’
package ‘tibble’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘tibble’
Warning in install.packages :
problem copying C:\Users\Niall Macsweeney\OneDrive\Documents\R\win-library\4.1\00LOCK\tibble\libs\x64\tibble.dll to C:\Users\Niall Macsweeney\OneDrive\Documents\R\win-library\4.1\tibble\libs\x64\tibble.dll: Permission denied
Warning in install.packages :
restored ‘tibble’
package ‘vctrs’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘vctrs’
Warning in install.packages :
problem copying C:\Users\Niall Macsweeney\OneDrive\Documents\R\win-library\4.1\00LOCK\vctrs\libs\x64\vctrs.dll to C:\Users\Niall Macsweeney\OneDrive\Documents\R\win-library\4.1\vctrs\libs\x64\vctrs.dll: Permission denied
Warning in install.packages :
restored ‘vctrs’
package ‘dplyr’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘dplyr’
Warning in install.packages :
problem copying C:\Users\Niall Macsweeney\OneDrive\Documents\R\win-library\4.1\00LOCK\dplyr\libs\x64\dplyr.dll to C:\Users\Niall Macsweeney\OneDrive\Documents\R\win-library\4.1\dplyr\libs\x64\dplyr.dll: Permission denied
Warning in install.packages :
restored ‘dplyr’
The downloaded binary packages are in
C:\Users\Niall Macsweeney\AppData\Local\Temp\RtmpqsZXkf\downloaded_packages
installing the source packages ‘rsample’, ‘sitar’
trying URL 'https://cran.rstudio.com/src/contrib/rsample_1.2.0.tar.gz'
Content type 'application/x-gzip' length 328388 bytes (320 KB)
downloaded 320 KB
trying URL 'https://cran.rstudio.com/src/contrib/sitar_1.4.0.tar.gz'
Content type 'application/x-gzip' length 549945 bytes (537 KB)
downloaded 537 KB
The downloaded source packages are in
‘C:\Users\Niall Macsweeney\AppData\Local\Temp\RtmpqsZXkf\downloaded_packages’
Any help appreciated thanks,
Niall
I am trying to build a sitar model and getting the following error with the dataset which has no NA and negative values.
Error in diff[pp != 0] <- pp[pp != 0] * ssize :
NAs are not allowed in subscripted assignments
Hello,
I attempted to plot mean curves by group according to your example (late v early menarche). The groups I am looking at are a group of infants who are exposed to HIV and those who are not exposed. See below code. Is there another way to plot the a and c parameters for both groups? Prior to making 'object' I made HEU/HUU status a factor variable called 'arm' where I have "HEU" below (where you had 'late' in your example) does it need to be the name of the factor var?
object <- sitar(x = weeks, y= length_cm, id = ptid, data = sitar_fin_len, df=3,
a.formula = ~HEU, c.formula = ~HEU)
plot(object, subset = HEU == FALSE, col = 4, lwd = 3,
y2par = list(col = 4, lwd = 2), ylim = range(sitar_fin_len$length_cm))
lines(object, subset = HEU == TRUE, col = 2, lwd = 3,
y2par = list(col = 2, lwd = 2))
legend('right', paste(c('HUU', 'HEU'), 'Exposure Status'),
lty = 1, col = c(4, 2), inset = 0.04)
I've been using sitar version 1.0.3 on R version 3.1.3. I recently updated sitar to version 1.0.7 and R to version 3.2.4 and re-ran some of my earlier models but found that the results had changed. The difference in results can be re-created using the heights dataset:
# running R version 3.1.3 and sitar 1.0.3
library(sitar)
data(heights)
mod103 <- sitar(age, height, id, heights, 3, random="c")
#print out variance explained, AIC, and BIC to compare to other version:
varexp(mod103)
mod103
78.09
AICadj(mod103)
mod103
662
BICadj(mod103)
mod103
681.8
###################################################
# running R version 3.2.4 and sitar 1.0.7
library(sitar)
data(heights)
mod107 <- sitar(age, height, id, heights, 3, random="c")
#print out variance explained, AIC, and BIC to compare to other version:
varexp(mod107)
mod107
32.65
AICadj(mod107)
mod107
779.6
BICadj(mod107)
mod107
799.3
So far, I've found that models including random effects for "a" and "b" alone to be equivalent, but there seems to be quite a difference in the above model when only including a random effect for "c" (especially in terms of the variance explained).
I see in the help notes that models fitted prior to 1.0.5 need refitting, but given this large difference in the variance explained, I was wondering which of these model fits is the appropriate one? Apologies if I missing something in the documentation that explains this!
Hi,
I am using sitar for infant growth trajectories. I have data at ~6 weeks (enrollment), 6 months, and 12 months. Is there a best practice for using this type of age in sitar models? We can assume visit time is equivalent to age as most infants were enrolled at the same time and seen at 6 weeks, 6 months, and 12 months.
Hi Tim,
I was wondering if you might want to add an option to display a confidence band on the population-averaged trajectory as displayed by plot.sitar()
? In my research setting the measures aren't spaced equally over time (there are more later time points and few earlier time points) so I'm really interested in seeing how the precision of the curve changes across the time period.
Just a thought 💭 !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.