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
          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 on Modified Bases...
          Yesterday, 07:01 AM
        • seqadmin
          Current Approaches to Protein Sequencing
          by seqadmin


          Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
          04-04-2024, 04:25 PM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, 04-11-2024, 12:08 PM
        0 responses
        55 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 10:19 PM
        0 responses
        51 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 09:21 AM
        0 responses
        45 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-04-2024, 09:00 AM
        0 responses
        55 views
        0 likes
        Last Post seqadmin  
        Working...
        X