Λογότυπο Survival Km Cox

Survival Km Cox

Κοινότητα
sagirimo
survival-km-cox

Αναλύστε δεδομένα χρόνου έως συμβάν με δεξιά λογοκρισία, χρησιμοποιώντας Kaplan–Meier, διαστήματα εμπιστοσύνης Greenwood log/log-log, συνήθεις ή διαστρωματωμένους ελέγχους log-rank, παλινδρόμηση Cox Breslow/Efron με διαστρωμάτωση και ανθεκτική στη συσχέτιση συνδιακύμανση, βασικούς κινδύνους, ατομικές καμπύλες επιβίωσης και διαφορές RMST σε numpy/scipy/pandas όταν το R δεν είναι διαθέσιμο. Επικυρώθηκε αριθμητικά έναντι των R survival και survRM2.

Add to TypingMind

Επισκόπηση

Εκδότηςsagirimo
ΑποθετήριοBioDSH
Όνομα δεξιότηταςsurvival-km-cox
Αστέρια
65
Διακλαδώσεις
2
Συνοδευτικά αρχεία
10
Άδεια χρήσηςMIT
Σύνδεσμοι
  • Οδηγίες σε Markdown

    Ένα αρχείο SKILL.md που το μοντέλο φορτώνει όταν χρειάζεται, ώστε να καταναλώνει token μόνο όταν ένα αίτημα είναι πράγματι σχετικό.

  • Λειτουργεί με οποιοδήποτε LLM

    Οι δεξιότητες AI είναι απλό Markdown, όχι κώδικας για συγκεκριμένο πάροχο, επομένως αυτή η δεξιότητα λειτουργεί με GPT, Claude, Gemini, Grok ή ένα τοπικό μοντέλο.

  • Συνοδευτικά αρχεία: 10

    Αρχεία script, πρότυπα και υλικό αναφοράς που μπορεί να διαβάζει το μοντέλο καθώς εργάζεται. Τα αρχεία είναι μόνο για ανάγνωση και δεν εκτελούνται ποτέ.

  • Ανοιχτού κώδικα

    Δημοσιεύτηκε στο GitHub από τον λογαριασμό sagirimo. Ελέγξτε τα αρχεία της δεξιότητας στο αποθετήριο πριν την εγκαταστήσετε.

Εγκατάσταση

Εγκαταστήστε τη δεξιότητα AI Survival Km Cox στο TypingMind για να τη χρησιμοποιείτε με οποιοδήποτε LLM ή προσθέστε τη σε άλλον πράκτορα AI που διαβάζει αρχεία SKILL.md.

1

Εγκατάσταση στο TypingMind

Το TypingMind εγκαθιστά μια δεξιότητα απευθείας από τον φάκελό της στο GitHub — διαβάζει το SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία σε πακέτο και αποθηκεύει το αποτέλεσμα τοπικά.

  1. Ανοίξτε την εφαρμογή και μεταβείτε στα Πρόσθετα → Δεξιότητες.
  2. Επιλέξτε «Εγκατάσταση από GitHub».
  3. Επικολλήστε το παρακάτω URL του φακέλου της δεξιότητας και επιβεβαιώστε.
    https://github.com/sagirimo/BioDSH/tree/main/biodsh-core/skills/survival-km-cox
  4. Ενεργοποιήστε τη δεξιότητα σε κάθε συνομιλία όπου θέλετε να είναι διαθέσιμη.
Πρόσθετα → Δεξιότητες → Προσθήκη δεξιότητας → Από URL του GitHub, έπειτα επικολλήστε το URL του φακέλου και πατήστε «Συνέχεια».
2

Εγκατάσταση σε άλλον πράκτορα AI

Κάθε πράκτορας AI που υποστηρίζει τη μορφή Agent Skills μπορεί να χρησιμοποιήσει αυτή τη δεξιότητα — αντιγράψτε τον φάκελο στον κατάλογο δεξιοτήτων του.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/sagirimo/BioDSH.git /tmp/BioDSH
mkdir -p .claude/skills
cp -r /tmp/BioDSH/biodsh-core/skills/survival-km-cox .claude/skills/survival-km-cox
Επανεκκινήστε το Claude Code μετά την αντιγραφή, ώστε να εντοπίσει τη νέα δεξιότητα.

Χρησιμοποιήστε τη στο TypingMind

Ενεργοποιήστε τη δεξιότητα Survival Km Cox σε οποιαδήποτε συνομιλία στο TypingMind και το μοντέλο αναλαμβάνει τα υπόλοιπα. Το όνομα και η περιγραφή της περιλαμβάνονται στην προτροπή συστήματος και, μόλις προκύψει ένα σχετικό αίτημα, το μοντέλο φορτώνει μόνο του τις πλήρεις οδηγίες — δεν χρειάζεται ποτέ να την καλείτε χειροκίνητα και δεν καταναλώνει token μέχρι να χρησιμοποιηθεί πραγματικά.

Το μοντέλο φορτώνει αυτόματα τη δεξιότητα Survival Km Cox μόλις λάβει ένα σχετικό αίτημα.

Λειτουργεί με οποιοδήποτε μοντέλο AI

Οι δεξιότητες AI είναι οδηγίες σε απλό κείμενο Markdown και όχι κώδικας για συγκεκριμένο πάροχο, οπότε η δεξιότητα Survival Km Cox δεν περιορίζεται στο μοντέλο για το οποίο γράφτηκε. Εγκαταστήστε τη μία φορά στο TypingMind και χρησιμοποιήστε τη με GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ή ένα τοπικό μοντέλο που εκτελείτε εσείς — πάντα με τα δικά σας κλειδιά API.

  • Φόρτωση μόνο όταν χρειάζεται

    Η προτροπή συστήματος περιλαμβάνει μόνο το όνομα και την περιγραφή. Οι οδηγίες ανακτώνται με το πρώτο σχετικό αίτημα, οπότε μια δεξιότητα που δεν χρησιμοποιείται δεν έχει κόστος.

  • Αλλάξτε μοντέλο κατά τη διάρκεια της συνομιλίας

    Επειδή η δεξιότητα αποτελείται από οδηγίες και όχι από κώδικα, η αλλαγή μοντέλου δεν επηρεάζει τη λειτουργία της — το επόμενο μοντέλο διαβάζει το ίδιο αρχείο SKILL.md.

Οδηγίες δεξιότητας

Αυτό είναι το περιεχόμενο του αρχείου SKILL.md που φορτώνει το μοντέλο. Διαβάστε το πριν από την εγκατάσταση — μια δεξιότητα αποτελείται από οδηγίες που θα ακολουθήσει το μοντέλο σας.

Survival analysis in Python

Use the adjacent survival_py.py library, or copy its required functions and helpers into a self-contained analysis script. It uses only numpy, scipy and pandas, has no file IO or global mutable state, and does not change inputs. The supported data are one right-censored record per subject, unweighted, with fixed covariates. Read VALIDATION.md for reference versions, numeric comparisons and reproduction commands.

Workflow

  1. Align outcome, covariates, group, stratum and cluster by subject ID. Set status=1 for the event of interest and 0 for right censoring; use finite nonnegative follow-up in a common time unit. Missing values raise an error. If exclusion is justified, create one shared complete-case mask, apply it to every array, and report exclusions. Do not turn a competing event into an ordinary event without defining the estimand.
  2. If administrative censoring is requested, call administrative_censor(time, status, tau) before every relevant fit: time=min(time,tau), status=status*(time<=tau). An event exactly at tau remains an event. RMST integrates to tau directly; pre-truncating yields the same RMST and variance.
  3. For descriptive curves, fit kaplan_meier(t, e, conf_type='log-log') in each group. conf_type='log' is also supported. Results cover all unique observation times, including censor-only times. Plot as right-continuous steps starting at (0,1) before applying any event at time zero; report n_risk, n_event, n_censor, survival, se, lower, upper.
  4. For group comparison, call logrank(t,e,group,strata=None) or supply strata. Report the full covariance, observed, expected, score=observed-expected, chi-square statistic, df and p_value. For k groups, df is the number with positive expected events minus one. Strata pool scores and covariances, not chi-square statistics. observed_by_stratum and expected_by_stratum are group × stratum; covariance_by_stratum is stratum × group × group. Labels are sorted.
  5. For adjusted hazard ratios, construct a finite n × p design without an intercept, with explicit reference levels. Call coxph(t,e,X,strata=s,cluster=subject_cluster,ties='efron'); omit optional arrays as appropriate. Choose the tie method from the analysis specification. Strata receive separate baseline hazards and share coefficients; a cluster defines score aggregation and can cross strata. Record design columns and their order. Singular models and nonconvergence raise errors instead of silently returning estimates.
  6. Read coefficients, hazard_ratio, se, z, p_value, coef_lower, coef_upper, covariance and model_covariance. Coefficient intervals are on the log hazard scale; exponentiate them for hazard-ratio intervals. wald, score_test, likelihood_ratio, and (with clusters) robust_score contain statistic, df, p_value. The global null is beta=0; coefficient tests use a normal reference, global tests chi-square with p df, with no cluster t or G−1 adjustment.
  7. Obtain baseline_hazard(fit,method='breslow') and predict_survival(fit,newx,times,strata=new_strata,method='breslow'). Each baseline table contains time, increment, cumulative_hazard, stratum, reference. The default reference is the column means used internally. Set reference=np.zeros(p) to obtain a literal x=0 baseline. Predictions are nnew × ntimes, right-continuous; times may be unordered. Specify a known stratum per new row for stratified fits. Prediction beyond a requested stratum's last observation raises an error.
  8. For RMST, predefine a common tau within each arm's observed support. rmst(t,e,tau) returns the KM area, variance, SE and normal CI. rmst_difference(t,e,group,tau) requires groups 0 and 1 and returns arm 1 minus arm 0, independent-arm variance, z, p and CI, plus individual arms. Report the time unit and tau. These CIs are not clipped to [0,tau].
python
import numpy as np
from survival_py import coxph, predict_survival, rmst_difference

# Arrays t, event, treatment, age, site, cluster have already been aligned.
X = np.column_stack([treatment, (age - 50) / 10])
f = coxph(t, event, X, strata=site, cluster=cluster, ties='efron')
hr = np.exp(f['coefficients'])
hr_ci = np.column_stack([np.exp(f['coef_lower']), np.exp(f['coef_upper'])])
# Use time points supported by every requested site.
s = predict_survival(f, [[0, 0], [1, 0]], [1, 3, 5],
                     strata=[site[0], site[0]], method='breslow')
r = rmst_difference(t, event, treatment, tau=5)

Numerical conventions and intermediate outputs

  • KM: S(t)=prod(1-d_j/n_j) and Greenwood G(t)=sum[d_j/(n_j*(n_j-d_j))]. The survival-scale variance is S²G. std_err_log=sqrt(G) matches the raw R survfit object; se=S*sqrt(G) matches the summary scale where finite. Log intervals transform log(S) ± z*sqrt(G); log-log intervals transform log(-log(S)) ± z*sqrt(G)/abs(log(S)) with endpoints reversed on back-transform.
  • Log-rank: at each pooled event time let p be group risk proportions and d total events. Add d*p to expected counts and d*(n-d)/(n-1)*(diag(p)-p*p.T) to covariance, with zero contribution for n≤1. Tied censoring stays in the risk set. The full covariance is singular; one active group is removed to form the chi-square contrast. No events returns statistic=0, df=0, p=NaN (an explicit library convention); disconnected/nonestimable contrasts raise.
  • Cox: each event-time contribution is sum_event(x beta)-sum_l log(S0-f_l*E0), where f_l=l/d for Efron and 0 for Breslow; risk-set weighted first and second moments give the score and observed information. cox_components(t,e,X,beta,strata,ties) evaluates these at any supplied beta, with per-time risk sums, death-risk sums, means, scores, information and log likelihood. Its X is used directly. In fitted tables, X is centered at fit['reference'], so add the reference to mean when comparing raw R coxph.detail$means. Time/risk/event/hazard arrays use all observed times; other arrays use event_time only. Information is event × p × p.
  • Robust Cox covariance: with individual score residuals U_i and cluster scores U_g, meat=sum_g U_g U_g.T, model_covariance=information^-1, and covariance=model_covariance @ meat @ model_covariance. There is no small-sample multiplier. Individual scores include risk-set contributions from censored observations and Efron tied-death corrections. score_residuals, cluster_scores, meat, null_score, and null_information are exposed. Wald/SE use selected covariance; ordinary score and LR remain model-based. robust_score uses clustered null-score residuals, matching R's separate robust score test.
  • RMST: widths run from 0 through observation times to tau; areas=widths*left_interval_survival, estimate=sum(areas). The variance is sum_j tail_area_j²*d_j/[n_j*(n_j-d_j)]; the tail area starts after event j. When n_j=d_j its contribution is 0 because survival afterwards is 0. Outputs include interval widths, areas, tail_areas, greenwood_increment, variance_contributions for audit.

Pitfalls that change numbers

  • Breslow and Efron are different with ties. In the tied simulation, the treatment log-HR is 0.3958037840 versus 0.4116484954; without ties both are 0.6313650454. Do not quietly change tie methods.
  • R basehaz() inherits the model's tie method. An Efron-fitted model therefore needs baseline_hazard(fit,method='efron') to match basehaz, while the default here remains Breslow as its name specifies. R survfit(fit,ctype=1) matches Breslow and ctype=2 matches Efron after an Efron fit. Efron hazard reconstruction after a Breslow fit is not exposed.
  • Baseline hazards depend on the reference covariate vector. This library centers all columns at their means; R by default excludes binary columns from centering. For validation use R nocenter=NULL, or compare x=0 hazards / predictions for the same explicit covariates. Coefficients and subject predictions are unaffected by the choice of reference.
  • A censor at an event time remains at risk for that event. In the small edge data, time 1 has risk set 7, one event and one censor, giving survival 6/7, not 5/6. time<=tau, not <tau, retains a boundary event.
  • When the final risk set all fail, KM survival is 0: raw R log-SE and Greenwood are Inf, survival variance/SE and both transformed CIs are NaN. Preserve these undefined quantities. For all-censored data, S=1, variance=0, CI=[1,1]. RMST variance can remain finite even when terminal Greenwood diverges.
  • Use the full score residual, not only the event contribution, for cluster covariance. Never treat strata as clusters unless that is the intended sampling unit. Cluster adjustment does not handle dependent observations for KM, log-rank or RMST in this library.
  • RMST is a step-function integral, not trapezoidal interpolation. At tau=10 the two validation arm differences are −1.7206913791 and −1.1994997261. The library conservatively rejects tau beyond each arm's last observation, even if some R endpoint conventions permit it.
  • Exact floating-point equality defines ties here. R may merge nearby times via timefix; harmonize times explicitly when that behavior is wanted. These fixtures assert that R's aeqSurv makes no changes before log-rank comparison.
  • R summary.coxph$waldtest['test'] rounds the statistic to 2 decimals. Compare fit$wald.test for full precision. At the fitted optimum, a score of order 1e−13 is numerical zero: pure relative errors are misleading there; use absolute error as documented in validation.
  • A stratum with no events contributes zero likelihood/score/information, has zero baseline cumulative hazard and predicted S=1. A globally event-free Cox model or a model with insufficient within-stratum covariate variation is not estimable and raises.

Checks before reporting

  • Subject counts, exclusions, group sizes, event counts, units, event definition and administrative tau are explicit.
  • Labels/design columns and comparison direction match the question; no intercept or duplicate columns entered Cox.
  • Tie method, reference covariates, strata and cluster units are recorded; model and robust covariance are distinguished.
  • Fit converged; coefficients/SEs are finite; information is identifiable. There are enough independent clusters to justify the intended asymptotic inference.
  • KM/predicted curves are nonincreasing in sorted time, in [0,1]; risk/event/censor counts agree with the data.
  • RMST uses the same tau for both arms, lies in [0,tau], and its difference has the declared direction.
  • Assess independent-censoring and proportional-hazards assumptions in context. This library does not automatically diagnose them.

Not implemented

Left truncation or start-stop data; time-varying covariates; recurrent events; interval censoring; competing-risk/Aalen–Johansen models; observation weights; exact Cox ties; offsets, penalization, frailty or random effects; automatic time repair or NA omission; Schoenfeld PH tests; Cox survival-curve confidence bands; robust KM/log-rank/RMST; RMST ratios or covariate-adjusted RMST; finite-cluster corrections or cluster t inference. Do not substitute supported methods silently when these are required.

References

R coxph, coxph.detail, survfit.coxph, and survRM2::rmst2. Numerical authority is the installed package versions recorded in VALIDATION.md, including direct checks of survfit, survdiff, coxph, basehaz, and rmst2.

Συνοδευτικά αρχεία

Το μοντέλο τα διαβάζει όποτε χρειάζεται, όσο η δεξιότητα είναι φορτωμένη. Διατίθενται ως αρχεία για ανάγνωση και δεν εκτελούνται ποτέ.

Συχνές ερωτήσεις

Τι κάνει η δεξιότητα AI Survival Km Cox;

Αναλύστε δεδομένα χρόνου έως συμβάν με δεξιά λογοκρισία, χρησιμοποιώντας Kaplan–Meier, διαστήματα εμπιστοσύνης Greenwood log/log-log, συνήθεις ή διαστρωματωμένους ελέγχους log-rank, παλινδρόμηση Cox Breslow/Efron με διαστρωμάτωση και ανθεκτική στη συσχέτιση συνδιακύμανση, βασικούς κινδύνους, ατομικές καμπύλες επιβίωσης και διαφορές RMST σε numpy/scipy/pandas όταν το R δεν είναι διαθέσιμο. Επικυρώθηκε αριθμητικά έναντι των R survival και survRM2.

Γιατί να χρησιμοποιήσετε τη δεξιότητα Survival Km Cox στο TypingMind;

Επειδή την εγκαθιστάτε μία φορά και τη χρησιμοποιείτε με οποιοδήποτε μοντέλο. Η Survival Km Cox είναι απλό Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως η ίδια δεξιότητα λειτουργεί με GPT-5, Claude, Gemini, Grok ή ένα τοπικό μοντέλο — και μπορείτε να αλλάξετε μοντέλο κατά τη διάρκεια της συνομιλίας χωρίς να διακοπεί η λειτουργία της. Το TypingMind λειτουργεί με τα δικά σας κλειδιά API, οπότε πληρώνετε απευθείας τους παρόχους αντί για συνδρομή ανά θέση χρήστη, ενώ οι δεξιότητες και οι συνομιλίες σας παραμένουν στον δικό σας χώρο αποθήκευσης.

Πώς εγκαθιστώ τη δεξιότητα Survival Km Cox στο TypingMind;

Στο TypingMind, ανοίξτε Πρόσθετα → Δεξιότητες → Εγκατάσταση από το GitHub και επικολλήστε τη διεύθυνση https://github.com/sagirimo/BioDSH/tree/main/biodsh-core/skills/survival-km-cox. Το TypingMind διαβάζει το αρχείο SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία και εγκαθιστά τη δεξιότητα, την οποία μπορείτε να ενεργοποιείτε ανά συνομιλία.

Ποια μοντέλα AI μπορούν να χρησιμοποιήσουν τη δεξιότητα Survival Km Cox;

Οποιοδήποτε μοντέλο συνδέετε στο TypingMind. Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως τα GPT, Claude, Gemini, Grok και τα τοπικά μοντέλα μπορούν όλα να φορτώσουν αυτή τη δεξιότητα όταν ένα αίτημα αντιστοιχεί σε αυτή.

Με πόσα μοντέλα AI μπορώ να χρησιμοποιήσω τη δεξιότητα Survival Km Cox;

Με όσα θέλετε. Στο TypingMind μπορείτε να χρησιμοποιήσετε τη δεξιότητα Survival Km Cox με οποιοδήποτε μοντέλο υποστηρίζει δεξιότητες, όπως τα GPT, Claude, Gemini, Grok, DeepSeek, Mistral και Llama, χρησιμοποιώντας τα δικά σας κλειδιά API.

Είναι δωρεάν η δεξιότητα AI Survival Km Cox;

Ναι. Δημοσιεύεται στο GitHub από τον λογαριασμό sagirimo με την άδεια χρήσης MIT. Πληρώνετε μόνο τον δικό σας πάροχο AI για τα token που χρησιμοποιείτε.

Τι είναι οι δεξιότητες AI;

Μια δεξιότητα AI είναι ένα επαναχρησιμοποιήσιμο πακέτο οδηγιών που διδάσκει σε ένα μοντέλο AI πώς να εκτελεί μια συγκεκριμένη εργασία. Ακολουθεί την ανοιχτή μορφή Agent Skills: ένα αρχείο SKILL.md με όνομα και περιγραφή, μαζί με τυχόν σενάρια κώδικα, πρότυπα ή αρχεία αναφοράς που μπορεί να χρειαστεί το μοντέλο. Το μοντέλο διαβάζει τις οδηγίες μόνο όταν το αίτημά σας αντιστοιχεί στη δεξιότητα, οπότε μια εγκατεστημένη δεξιότητα δεν κοστίζει τίποτα μέχρι να χρησιμοποιηθεί.

Σε τι διαφέρουν οι δεξιότητες AI από τα πρόσθετα ή τους συνδέσμους MCP;

Ένα πρόσθετο ή ένας σύνδεσμος MCP παρέχει στο μοντέλο νέα εργαλεία που μπορεί να καλέσει — κώδικα που εκτελείται κάπου και επιστρέφει ένα αποτέλεσμα. Μια δεξιότητα AI παρέχει αντί γι’ αυτό γνώσεις και διαδικασίες στο μοντέλο: πώς να προσεγγίσει μια εργασία, ποια βήματα να ακολουθήσει και ποια χαρακτηριστικά έχει ένα καλό αποτέλεσμα. Οι δεξιότητες είναι απλό Markdown, επομένως δεν χρειάζονται διακομιστή, κλειδί API ή περιβάλλον εκτέλεσης και λειτουργούν με οποιοδήποτε μοντέλο.

Προβολή όλων
Λογότυπο nextlevelbuilder

Ui Styling

nextlevelbuilder
ΟργανισμόςΔημοφιλής

Create beautiful, accessible user interfaces with shadcn/ui components (built on Radix UI + Tailwind), Tailwind CSS utility-first styling, and canvas-based visual designs. Use when building user…

15K
141.1K
Αρχεία: 95
Προβολή
Λογότυπο garrytan

Landing Report

garrytan
ΚοινότηταΔημοφιλής

Πίνακας ελέγχου ουράς μόνο για ανάγνωση για αποστολή με επίγνωση του χώρου εργασίας. (gstack)

19.9K
133.5K
Αρχεία: 1
Προβολή
Λογότυπο garrytan

Gstack Openclaw Ceo Review

garrytan
ΚοινότηταΔημοφιλής

Χρησιμοποιήστε το όταν σας ζητείται να αξιολογήσετε ένα σχέδιο, να αμφισβητήσετε μια πρόταση, να κάνετε αξιολόγηση CEO, να εντοπίσετε αδύναμα σημεία σε μια προσέγγιση, να διευρύνετε τη σκέψη για το εύρος του έργου ή να αποφασίσετε αν πρέπει να επεκταθεί ή να περιοριστεί το σχέδιο.

19.9K
133.5K
Οδηγίες
Προβολή
Λογότυπο JuliusBrussee

Caveman Stats

JuliusBrussee
ΚοινότηταΔημοφιλής

Εμφανίζει την καταγεγραμμένη χρήση token για output και cache reads, καθώς και την απόδοση λειτουργίας για την τρέχουσα συνεδρία Claude Code, ή εντοπίζει την εγγενή αναφορά χρήσης του host. Ενεργοποίηση: /caveman-stats.

6.2K
106.3K
Οδηγίες
Προβολή

Δημιουργήστε τώρα τον δικό σας χώρο εργασίας AI

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇