Linear regression model with (categorical) predictor variables The Next CEO of Stack Overflow2019 Community Moderator ElectionNeural Network Timeseries Modeling with Predictor VariablesTime Series Machine Learning Feature Selection ProblemWhy after adding categorical data the Linear Regression fails?Handling categorical variables in linear regression and random forestcustomer segmentation with categorical variablesLinear Model for Linear RegressionRegression model for continuous dependent variable and count independent variablesIntuitive Explanation of R-squaredGet insights from Random forest::Variable Importance analysis

Preparing Indesign booklet with .psd graphics for print

On model categories where every object is bifibrant

What is the result of assigning to std::vector<T>::begin()?

What does convergence in distribution "in the Gromov–Hausdorff" sense mean?

How do I go from 300 unfinished/half written blog posts, to published posts?

Can I equip Skullclamp on a creature I am sacrificing?

Is it ever safe to open a suspicious html file (e.g. email attachment)?

Is it possible to search for a directory/file combination?

Return the Closest Prime Number

Non-deterministic sum of floats

Why does standard notation not preserve intervals (visually)

Can we say or write : "No, it'sn't"?

Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?

Is micro rebar a better way to reinforce concrete than rebar?

If Nick Fury and Coulson already knew about aliens (Kree and Skrull) why did they wait until Thor's appearance to start making weapons?

At which OSI layer a user-generated data resides?

Why does the UK parliament need a vote on the political declaration?

Why do remote companies require working in the US?

Why am I allowed to create multiple unique pointers from a single object?

Why do airplanes bank sharply to the right after air-to-air refueling?

How does the mv command work with external drives?

Unreliable Magic - Is it worth it?

What happened in Rome, when the western empire "fell"?

Why has the US not been more assertive in confronting Russia in recent years?



Linear regression model with (categorical) predictor variables



The Next CEO of Stack Overflow
2019 Community Moderator ElectionNeural Network Timeseries Modeling with Predictor VariablesTime Series Machine Learning Feature Selection ProblemWhy after adding categorical data the Linear Regression fails?Handling categorical variables in linear regression and random forestcustomer segmentation with categorical variablesLinear Model for Linear RegressionRegression model for continuous dependent variable and count independent variablesIntuitive Explanation of R-squaredGet insights from Random forest::Variable Importance analysis










1












$begingroup$


I used LM model with (categorical) predictor variables on my data in r like this (I have count variable as dependent/target variable):



# Fit linear model to total viewing:
fit <- lm(
total_viewing_minutes ~ panelist + sex + internet + education,
data = cln
)


If I understood correctly in r the first category is always the reference one so has by definition a coefficient of 0.



So by looking at the model result, is 68.3 minutes (intercept) average time viewing of



Panelist0 + sex1 + internet1 + education1 


and by taking into account the term Panelist1

the 68.4 + 17.6 is avg time viewing of



 Panelist1 + sex1 + internet1 + education1 


is that correct interpretation?



enter image description here










share|improve this question









$endgroup$




bumped to the homepage by Community 11 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.



















    1












    $begingroup$


    I used LM model with (categorical) predictor variables on my data in r like this (I have count variable as dependent/target variable):



    # Fit linear model to total viewing:
    fit <- lm(
    total_viewing_minutes ~ panelist + sex + internet + education,
    data = cln
    )


    If I understood correctly in r the first category is always the reference one so has by definition a coefficient of 0.



    So by looking at the model result, is 68.3 minutes (intercept) average time viewing of



    Panelist0 + sex1 + internet1 + education1 


    and by taking into account the term Panelist1

    the 68.4 + 17.6 is avg time viewing of



     Panelist1 + sex1 + internet1 + education1 


    is that correct interpretation?



    enter image description here










    share|improve this question









    $endgroup$




    bumped to the homepage by Community 11 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















      1












      1








      1





      $begingroup$


      I used LM model with (categorical) predictor variables on my data in r like this (I have count variable as dependent/target variable):



      # Fit linear model to total viewing:
      fit <- lm(
      total_viewing_minutes ~ panelist + sex + internet + education,
      data = cln
      )


      If I understood correctly in r the first category is always the reference one so has by definition a coefficient of 0.



      So by looking at the model result, is 68.3 minutes (intercept) average time viewing of



      Panelist0 + sex1 + internet1 + education1 


      and by taking into account the term Panelist1

      the 68.4 + 17.6 is avg time viewing of



       Panelist1 + sex1 + internet1 + education1 


      is that correct interpretation?



      enter image description here










      share|improve this question









      $endgroup$




      I used LM model with (categorical) predictor variables on my data in r like this (I have count variable as dependent/target variable):



      # Fit linear model to total viewing:
      fit <- lm(
      total_viewing_minutes ~ panelist + sex + internet + education,
      data = cln
      )


      If I understood correctly in r the first category is always the reference one so has by definition a coefficient of 0.



      So by looking at the model result, is 68.3 minutes (intercept) average time viewing of



      Panelist0 + sex1 + internet1 + education1 


      and by taking into account the term Panelist1

      the 68.4 + 17.6 is avg time viewing of



       Panelist1 + sex1 + internet1 + education1 


      is that correct interpretation?



      enter image description here







      machine-learning r linear-regression categorical-data






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 22 at 18:16









      AnnAnn

      61




      61





      bumped to the homepage by Community 11 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 11 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          Your interpretation is correct. I would also add that if Panelist1 increases by 1 unit and the other predictors are held constant, then the average increase in the response variable is 17.557 minutes.






          share|improve this answer









          $endgroup$













            Your Answer





            StackExchange.ifUsing("editor", function ()
            return StackExchange.using("mathjaxEditing", function ()
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            );
            );
            , "mathjax-editing");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "557"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f46054%2flinear-regression-model-with-categorical-predictor-variables%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0












            $begingroup$

            Your interpretation is correct. I would also add that if Panelist1 increases by 1 unit and the other predictors are held constant, then the average increase in the response variable is 17.557 minutes.






            share|improve this answer









            $endgroup$

















              0












              $begingroup$

              Your interpretation is correct. I would also add that if Panelist1 increases by 1 unit and the other predictors are held constant, then the average increase in the response variable is 17.557 minutes.






              share|improve this answer









              $endgroup$















                0












                0








                0





                $begingroup$

                Your interpretation is correct. I would also add that if Panelist1 increases by 1 unit and the other predictors are held constant, then the average increase in the response variable is 17.557 minutes.






                share|improve this answer









                $endgroup$



                Your interpretation is correct. I would also add that if Panelist1 increases by 1 unit and the other predictors are held constant, then the average increase in the response variable is 17.557 minutes.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 27 at 22:08









                N. AgarwalN. Agarwal

                11




                11



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Data Science Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f46054%2flinear-regression-model-with-categorical-predictor-variables%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Ружовы пелікан Змест Знешні выгляд | Пашырэнне | Асаблівасці біялогіі | Літаратура | НавігацыяДагледжаная версіяправерана1 зменаДагледжаная версіяправерана1 змена/ 22697590 Сістэматыкана ВіківідахВыявына Вікісховішчы174693363011049382

                    ValueError: Error when checking input: expected conv2d_13_input to have shape (3, 150, 150) but got array with shape (150, 150, 3)2019 Community Moderator ElectionError when checking : expected dense_1_input to have shape (None, 5) but got array with shape (200, 1)Error 'Expected 2D array, got 1D array instead:'ValueError: Error when checking input: expected lstm_41_input to have 3 dimensions, but got array with shape (40000,100)ValueError: Error when checking target: expected dense_1 to have shape (7,) but got array with shape (1,)ValueError: Error when checking target: expected dense_2 to have shape (1,) but got array with shape (0,)Keras exception: ValueError: Error when checking input: expected conv2d_1_input to have shape (150, 150, 3) but got array with shape (256, 256, 3)Steps taking too long to completewhen checking input: expected dense_1_input to have shape (13328,) but got array with shape (317,)ValueError: Error when checking target: expected dense_3 to have shape (None, 1) but got array with shape (7715, 40000)Keras exception: Error when checking input: expected dense_input to have shape (2,) but got array with shape (1,)

                    Illegal assignment from SObject to ContactFetching String, Id from Map - Illegal Assignment Id to Field / ObjectError: Compile Error: Illegal assignment from String to BooleanError: List has no rows for assignment to SObjectError on Test Class - System.QueryException: List has no rows for assignment to SObjectRemote action problemDML requires SObject or SObject list type error“Illegal assignment from List to List”Test Class Fail: Batch Class: System.QueryException: List has no rows for assignment to SObjectMapping to a user'List has no rows for assignment to SObject' Mystery