shah-in-boots / card Goto Github PK
View Code? Open in Web Editor NEWR package for analysis of cardiovascular research data
Home Page: https://shah-in-boots.github.io/card/
License: Other
R package for analysis of cardiovascular research data
Home Page: https://shah-in-boots.github.io/card/
License: Other
A number of functions didn't seem to aggregate well into a single package. I've chosen to focus on porting over similar functions to separate packages to maintain order. Crucially, the focus of the package has evolved and will be targeted more at cardiovascular data. Eventually, will move the cosinor
software to its own package to avoid overlap/confusion (however, this will likely be in version 0.3.0 after an appropriate deprecation process.
cosinor
functions in anticipation of porting them over to a more specific rhythm-focused project repositoryThis is the AF-CTRS score that we would like to implement to analyze patient responses, combining both symptom burden with electromechanical burden.
Problem with population cosinors, reported by DV.
Just to report that I found the following error when running cosinor for
calculating a population mean cosinor
Error in data.frame(population = rep(names(kfits), sapply(kfits, length)),
:
# arguments imply differing number of rows: 0, 520
To my best knowledge, I gave the same format to my file and relevant
variables as the Twins example file has. Twins runs ok, but not my file.
Even if I didn't find the reason for this, I solved it by running
cosinor_pop_impl and declaring kfits as data frame.
fits <- data.frame(
population = rep(names(as.data.frame(kfits)),
sapply(as.data.frame(kfits), length)),
yhat = unlist(kfits)
)
Originally, it returned
names (kfits)
NULL
sapply((kfits), length)
[1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 .....
After declaring kfits as data frame, it returns
names(as.data.frame(kfits))
[1] "1" "2" "3" "4" "5" "6"
sapply(as.data.frame(kfits), length)
1 2 3 4 5 6
520 520 520 520 520 520
Above documentation from message from DV. Code below is from DV as part of a MWE.
Code that would lead to this problem is below (generated by DV).
# cosinor test
library (card)
pmc.df.t <- as.data.frame(matrix(NA,3120,3)) # data frame for data
names(pmc.df.t) <- c("time","subject", "HR") # variable names
t <- c(1:520) # time
pmc.df.t[,1] <- rep(1:520,6) # six subjects
pmc.df.t[,2] <- rep(1:6,520)[order(rep(1:6,520))] # time for each subject
set.seed(1) # seed for rnd
# generates six different signals with some noise
for (i in 1:6){
M <- rnorm(1, mean=70, sd=5)
A <- rnorm(1, mean=3, sd=0.1)
phi <- rnorm(1, mean=60, sd=10)
e <- rnorm(c(1:520), mean=0, sd=5)
hr.curve <- M + A*cos((2*pi/260)*t+phi)+e
pmc.df.t[520*(i-1)+(1:520),3] <- hr.curve
print(plot(t,hr.curve))
}
# cosinor model
pmc.model.t <- cosinor(HR~time, data=pmc.df.t, tau = c(260), population = "subject")
Procedural codes by CMS need to be integrated into the package dataset such they can be evaluated and selected for in claims-based data.
Overarching aims for procedural code additions:
Specific tasks:
procedure_codes()
function generates appropriate procedural codesprocedure_codes()
with previous years of data (although weary of data size)code_to_description()
function converts codes appropriately to their descriptive version (as strings)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.