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
          Recent Advances in Sequencing Analysis Tools
          by seqadmin


          The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
          05-06-2024, 07:48 AM
        • seqadmin
          Essential Discoveries and Tools in Epitranscriptomics
          by seqadmin




          The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
          04-22-2024, 07:01 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, Yesterday, 02:46 PM
        0 responses
        11 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 05-07-2024, 06:57 AM
        0 responses
        13 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 05-06-2024, 07:17 AM
        0 responses
        16 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 05-02-2024, 08:06 AM
        0 responses
        23 views
        0 likes
        Last Post seqadmin  
        Working...
        X