Announcement

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

  • Factor variables may not contain noninteger values

    I am attempting to fit a regression model in STATA. My variables are are all continuous variables of type float.

    HTML Code:
    regress _gdp all_indexn_c 90_days consistent _incpc all_indexn_c#90_days
        
        all_indexn_c:  factor variables may not contain noninteger values
        r(452);
    Click image for larger version

Name:	YJ1xe.png
Views:	1
Size:	32.7 KB
ID:	1629181


    How do I fix this issue? I don't have factor variables and I'd like to use float variables in the model.

    Using STATA for the first time.

  • #2
    What is the # doing in your command? The way you use it implies that the variables before and after the pound sign should be treated as categorical and you are interacting them. Both variables should be preceded by c. If you want them treated as continuous. See

    help fvvarlist

    for more details.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Cross-posted and with a similar answer at https://stackoverflow.com/questions/...integer-values

      Please note our cross-posting policy, which is that you are asked to tell us about it. Please note https://www.statalist.org/forums/help -- all the way down to #18;

      Comment


      • #4
        Also, 90_days is not a legitimate variable name. The first character of a variable name must be a letter or an underscore. Further, starting variable names with an underscore is discouraged because all of Stata’s built-in variables begin with an underscore.
        Last edited by Richard Williams; 27 Sep 2021, 06:28.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        StataNow Version: 19.5 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://www3.nd.edu/~rwilliam

        Comment

        Working...
        X