Giter Site home page Giter Site logo

Comments (3)

aarizvi avatar aarizvi commented on August 12, 2024

Please send a reproducible example and I can look at it with you. In theory they shouldn't be off by an order of magnitude unless the genotyping (or imputation) quality is poor. We are using the same survival:::coxph.fit internal function in this package so the estimators are the same. The only difference is that in gwasurvivr we put in initial estimates that we obtain by fitting the model just the covariates first.

from gwasurvivr.

Qiaolan avatar Qiaolan commented on August 12, 2024

Thanks for your reply. I am sorry the data is in the server I cannot copy it.

Below are codes of two methods

  1. R survival::coxph:
    model <- coxph(Surv(age_onset,status) ~ cov_match[,28+i] +sex+pc1+pc2+pc3+pc4+pc5,data=cov_match,ties = "efron")

  2. gwasurvivr:

bed.file <- "data_clean/Two/cov_id.bed"
cov <- read.table("data_clean/Two/cov_match.txt",header=T)
sample.ids <- as.character(cov$merged_id)

plinkCoxSurv(bed.file=bed.file,
covariate.file=cov,
id.column="merged_id",
sample.ids=sample.ids,
time.to.event="age_onset",
event="status",
covariates=c("sex", "pc1","pc2","pc3","pc4","pc5"),
inter.term=NULL,
print.covs="only",
out.file= "/fs/project/PAS1501/gaolab/qldeng/Eden/data_clean/Two/result",
chunk.size=100,
maf.filter=0.01,
flip.dosage=TRUE,
verbose=TRUE,
clusterObj=cl)

I transferred bed file to 0/1/2 and it is contained in cov_match.txt used by cox.ph()

Also, I checked the source code of gwasurvivr and I did find that it uses coxph.fit() rather than coxph. Is there any difference? I find few manual about coxph.fit()

At last, you mentioned "The only difference is that in gwasurvivr we put in initial estimates that we obtain by fitting the model just the covariates first." When I use coxph() in R survial, is there anything I need to modify?

Thanks for your help!

from gwasurvivr.

Qiaolan avatar Qiaolan commented on August 12, 2024

Hi and thanks for your time!

Today I checked the sample data within the gwasurvivr package. The results of survival::coxph and gwasurvivr match. Moreover, I find there's no difference if I set initial values for coxph.fit, because both coxph and coxph.fit with initials gave me the same coefs. Is this possible?

At last, returning to my original problem, my data is case-only, that is, all subjects experienced the event. Is this a possible reason that two methods gave me different coefs?

Thank you!

from gwasurvivr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.