Questions tagged [dummy-variable]

Dummy or indicator variables are used to include categorical or qualitative variables in a regression model.

868 questions
-1
votes
2 answers

check all entries in a column sas and return a dummy variable sas

I am new in SAS and want to check if all entries in a variable in a data set satisfy a condition (namely =1) and return just one dummy variable 0 pr one depending whether all entries in the variable are 1 or at least one is not 1. Any idea how to…
Stefka
  • 21
  • 1
-1
votes
2 answers

Convert dummy variable to actual value

I have been working on a dataset which is represented in the following way: P1 P2 P3 P4 P5 0 2 1 0 1 0 1 0 0 0 0 0 0 3 0 0 0 0 1 1 0 0 5 0 0 1 1 0 0 0 I am trying to convert it in to a row in R…
-1
votes
1 answer

R: factors across columns as dummy variable

I am working in R and i need on below problem. I have my data in below format. Users Lang_1 Lang_2 Lang_3 Lang_4 Lang_5 user_1 C SAS Python SPSS Java user_2 R C++ Java user_3 SAS R Python Octave user_4 …
-2
votes
1 answer

Search for and extract words into new column

I have a dataset with 63,000 rows in R. One of the columns contained a list of words in the format '"Fireplace", "Garage", "One story with balcony", "Off street parking",' etc. They are property characteristics listed from sale websites. I want to…
-2
votes
1 answer

Trying to generate a dummy variable based on a range of data and one cell

I have a dataset that consists of two Date columns. Both of the date columns are in reference to different events happening. I want to generate a dummy variable that equals 1 if both of the dates and time match. For example, if one date is (YY/MM/DD…
-2
votes
1 answer

creating dummies out of multiple columns in a dataframe in python

i have a dataframe where i have identified 5 columns which need to be converted to dummies, but i am not able to create dummies from multiple columns. The entire dataframe is numerical in nature, no categorical values. consider i have 100 variables…
-2
votes
2 answers

How to use a skeleton program in Haskell

Here is a little look on how the dictionary program is built dictionary = [ ("thanks",["danke"]), ("always",["immer"]), ("us", ["uns"]) ] as u can see from the dictionary the strings comes in pair of (string, [string])
thenord
  • 37
  • 4
-2
votes
1 answer

Trying to create a Dummy for Covid period

I'm trying to create a dummy variable for specific dates (covid effect) When using the code below, got only NA's in the column. df$dummy <- ifelse(df$date > as.Date("2018-01-01", format = "%Y/%m/%d") & df$date <…
-2
votes
1 answer

Creating dummy variables for more than 2 levels

How do I create dummy variables for more than two levels for categorical data in r? I tried model.matrix but it didn’t work.
Paulyn
  • 9
  • 2
-2
votes
1 answer

Turn values to NA if sum of variables is larger than 1

I'm quite new in R so please forgive me if I don't use the right vocabulary. I am currently dealing with a dataset where I have a few dummy variables. The problem is that for some rows more than 1 dummy variable has a value of 1. If this is the case…
-2
votes
1 answer

How to one hot encode factor variable that has more than 3 levels?

I want to represent factor variables as 0 and 1 value through one hot encoding in r as data.frame. Among the factor variables, I would like to perform one hot encode only for variables with three or more levels. This is my R…
신익수
  • 67
  • 3
  • 8
-2
votes
1 answer

Dummy Package in R

Could someone help ? I am using the dummy package in R (function dummy) to convert a categorical variable(10 categories) into dummy variables because some of the algorithms I am using (adaboost and rotation forest), don't handle categorical…
Pepe
  • 1
  • 6
-2
votes
1 answer

How to insert a statement inbetween lines with the help of preprocessor directives in C++?

I'm trying to program an Arduino Due to PWM a LED matrix by turning the LEDs on and off very quickly. In order to control brightness I want to add extra instructions between the on and off states of the LEDs. The brightness should be set by a…
uzumaki
  • 1,743
  • 17
  • 32
-2
votes
1 answer

What is R algorithm for dummy coding model matrix?

I noticed when using a dummy coding for fitting my linear models R excludes certain parameters when forming model matrix. What is the R algorithm for doing this?
Justin Thong
  • 321
  • 3
  • 12
-2
votes
1 answer

how to collapse 2 variables by dummies in panel data

I have to collapse some variable of my dataset but I’m getting issues. Basically, there are 2 variables valor_receita_propria (in English is own_revenue_value) qt_tec_total (or total_tec_qt, the numberof technicians in a institution). There…
1 2 3
57
58