#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Dummy Variables

I have a column of 4 different Letters(H,B,A,S) and i want to create three
different dummy columns of 1's and 0's to do a regression. How do i create
an if statement to say if column A is H then 1 if not then 0? I've tried:
=if(A2=H,1,0) and it said there was Name error

Help Please
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,718
Default Dummy Variables

=IF(A2="H",1,0)

"rz-illini85" wrote:

I have a column of 4 different Letters(H,B,A,S) and i want to create three
different dummy columns of 1's and 0's to do a regression. How do i create
an if statement to say if column A is H then 1 if not then 0? I've tried:
=if(A2=H,1,0) and it said there was Name error

Help Please

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default Dummy Variables

=--A2="H"

etc.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)
"rz-illini85" wrote in message
...
I have a column of 4 different Letters(H,B,A,S) and i want to create three
different dummy columns of 1's and 0's to do a regression. How do i
create
an if statement to say if column A is H then 1 if not then 0? I've
tried:
=if(A2=H,1,0) and it said there was Name error

Help Please



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 196
Default Dummy Variables

Bob

Wouldn't that need to be:

=--(A2="H")

Richard



Bob Phillips wrote:

=--A2="H"

etc.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)
"rz-illini85" wrote in message
...
I have a column of 4 different Letters(H,B,A,S) and i want to create three
different dummy columns of 1's and 0's to do a regression. How do i
create
an if statement to say if column A is H then 1 if not then 0? I've
tried:
=if(A2=H,1,0) and it said there was Name error

Help Please


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default Dummy Variables

Of course it would, I kep making that error <g

Bob

(change the xxxx to gmail if mailing direct)
"RichardSchollar" wrote in message
oups.com...
Bob

Wouldn't that need to be:

=--(A2="H")

Richard



Bob Phillips wrote:

=--A2="H"

etc.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)
"rz-illini85" wrote in message
...
I have a column of 4 different Letters(H,B,A,S) and i want to create
three
different dummy columns of 1's and 0's to do a regression. How do i
create
an if statement to say if column A is H then 1 if not then 0? I've
tried:
=if(A2=H,1,0) and it said there was Name error

Help Please




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating dummy variables in Excel Alok Excel Worksheet Functions 0 November 30th 06 05:46 PM
Creating dummy variables in Excel ALEX Excel Worksheet Functions 0 November 30th 06 03:30 PM
RE-submitting of: constructing (complex) variables with worksheet functions broer konijn Excel Worksheet Functions 0 June 13th 06 11:36 AM
VBA reseting variables bpeltzer Excel Discussion (Misc queries) 0 February 4th 06 03:52 PM
How to hide a dummy series in a chart legend? holg3r New Users to Excel 2 July 14th 05 09:04 AM


All times are GMT +1. The time now is 11:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"