Ask Experts Questions for FREE Help!
 

Free Answers in 3 Easy Steps

Register Now
3 Steps
 


Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.
  Answer this Question    Ask about Math & Sciences    Ask about another Subject  
 

Lot2Learn
Oct 29, 2009, 01:42 AM
I want to create a variable with a specific range. For instance, this is the command I used:

.gen Rel = 0
.replace Rel = 5 if rel_pref > 2 & < 9

I received an error message that said < 9 was invalid. But there is a value 9. So is there something wrong with the command?

ArcSine
Oct 29, 2009, 06:08 AM
I'm not familiar with Stata's syntax, but here's a shot in the dark: Maybe you need to explicitly specify the variable for both of the inequalities, as in

[variable] > 2 & [variable] < 9

Lot2Learn
Oct 29, 2009, 08:20 AM
Thanks a lot! I tried it and it worked. I'm kind of new at Stata, and I don't always understand their help guides as they are written so technically.

I really appreciate your help.