Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • question about glm in R

    HI
    I know I post my question about R here is somehow not appropriate, but I really hope someone can teach me.

    I use glm in R to do logistic regression. and treat both response and predictor as factor
    In my first try:

    *******************************************************************************
    Call:
    glm(formula = as.factor(diagnostic) ~ as.factor(7161521) +
    as.factor(2281517), family = binomial())


    Deviance Residuals:
    Min 1Q Median 3Q Max
    -1.5370 -1.0431 -0.9416 1.3065 1.4331

    Coefficients:
    Estimate Std. Error z value Pr(>|z|)
    (Intercept) -0.58363 0.27948 -2.088 0.0368 *
    as.factor(7161521)2 1.39811 0.66618 2.099 0.0358 *
    as.factor(7161521)3 0.28192 0.83255 0.339 0.7349
    as.factor(2281517)2 -1.11284 0.63692 -1.747 0.0806 .
    as.factor(2281517)3 -0.02286 0.80708 -0.028 0.9774
    ---
    Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

    (Dispersion parameter for binomial family taken to be 1)

    Null deviance: 678.55 on 498 degrees of freedom
    Residual deviance: 671.20 on 494 degrees of freedom
    AIC: 681.2

    Number of Fisher Scoring iterations: 4
    *******************************************************************************

    And I remodel it and want no intercept:
    *******************************************************************************
    Call:
    glm(formula = as.factor(diagnostic) ~ as.factor(2281517) +
    as.factor(7161521) - 1, family = binomial())


    Deviance Residuals:
    Min 1Q Median 3Q Max
    -1.5370 -1.0431 -0.9416 1.3065 1.4331

    Coefficients:
    Estimate Std. Error z value Pr(>|z|)
    as.factor(2281517)1 -0.5836 0.2795 -2.088 0.0368 *
    as.factor(2281517)2 -1.6965 0.6751 -2.513 0.0120 *
    as.factor(2281517)3 -0.6065 0.8325 -0.728 0.4663
    as.factor(7161521)2 1.3981 0.6662 2.099 0.0358 *
    as.factor(7161521)3 0.2819 0.8325 0.339 0.7349
    ---
    Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

    (Dispersion parameter for binomial family taken to be 1)

    Null deviance: 691.76 on 499 degrees of freedom
    Residual deviance: 671.20 on 494 degrees of freedom
    AIC: 681.2

    Number of Fisher Scoring iterations: 4
    *******************************************************************************

    As show above in my second model it return no intercept but look this:
    Model1:
    (Intercept) -0.58363 0.27948 -2.088 0.0368 *
    Model2:
    as.factor(2281517)1 -0.5836 0.2795 -2.088 0.0368 *


    They are exactly the same. Could you please tell me what happen?

    Thank you in advance
    Last edited by tujchl; 11-20-2011, 03:15 AM.

  • #2
    Maybe try here?:

    Q&A for people interested in statistics, machine learning, data analysis, data mining, and data visualization

    Comment


    • #3
      Thank you cjp, I`ll try it on your wesite

      Comment


      • #4
        Tujchl,

        the canonical place for such questions is the R-help mailing list on the R-Project's website.

        Your formula expressions look complex to me, and I am not sure I understand your intention with (or the effect of) as.factor(2281517). Is '2281517' an integer constant or a variable name? On the risk of invoking a cliche, but perhaps some reading of the documentation of glm and of R's formula interface would be instructive.

        Best wishes
        Wolfgang
        Wolfgang Huber
        EMBL

        Comment

        Latest Articles

        Collapse

        • seqadmin
          Strategies for Sequencing Challenging Samples
          by seqadmin


          Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
          03-22-2024, 06:39 AM
        • seqadmin
          Techniques and Challenges in Conservation Genomics
          by seqadmin



          The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

          Avian Conservation
          Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
          03-08-2024, 10:41 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, Yesterday, 06:37 PM
        0 responses
        7 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, Yesterday, 06:07 PM
        0 responses
        7 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 03-22-2024, 10:03 AM
        0 responses
        49 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 03-21-2024, 07:32 AM
        0 responses
        66 views
        0 likes
        Last Post seqadmin  
        Working...
        X