Binding values from dataframe

I have an assignment asking me to evaluate the linear model of a variable y . One of my variable x. the Median Income is not significant enough in some of its ranges. I would like to bind the non significant values to an other range to increase the significancy. But every thing I try is not working.
Thank you

Hi Sarah, are we talking about bucketing continous data into discrete groups ?
If so, then I think the preferred terminology is 'recoding' rather than 'binding', binding has associations with attaching rows or columns together to make tables, whereas recoding means changing the codes that represent data. Am I on the right track ?
If so, the forcats package is useful, with handy helpers to assist with such things, or a manual approach would be using mutate from dplry/tidyverse packages. but I don't want to bombard you with syntax until I'm more confident I understand your issue.


Hi nigrahamuk,

I'm an not sure, here is the summary of my dataframe$MedianIncome:
(34218.1, 37413.8] (37413.8, 40362.7]
292 249
(40362.7, 42724.4] (42724.4, 45201]
204 125
(45201, 48021.6] (48021.6, 51046.4]
70 31
(51046.4, 54545.6] (54545.6, 61494.5]
19 10
(61494.5, 125635] [22640, 34218.1]
4 279
And would like to merge the two ranges (54 545.6, 61494.5] (61494.5, 125635] to one range (54 545.6,125635].
Is it possible?

I am only aloud to use these packages: MASS , lmtest , nortest , car , splines , AER.

Thank you

I'm afraid I'm signing off now, but I expect that others here can help you. It would be useful if you would use the command in the console


As this would make the data you want help with, shareable in a more convenient way. I'll check back tomorrow.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.