Announcement

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

  • range function generating over 400 missing values

    Hello,

    I am trying to make a Stata variable that stores 20 numbers between 0 and 1.
    I am using the range function for it, my line of code is:

    range alphas 0.0 1.0 20

    but instead of generating 20 numbers between 0 and 1, Stata is generating over 470 missing values -- why is this happening, and how can I solve this issue?

    Thank you,

  • #2
    Your dataset apparently already has over 490 observations in it, so the first 20 receive actual values for alpha, and the remaining observations received missing values for alpha. Here's a similar example.
    Code:
    . describe, short
    
    Contains data from gnxl.dta
      obs:            10                          
     vars:             1                          12 Oct 2019 09:37
    Sorted by: 
    
    . range x 0 1 5
    (5 missing values generated)
    
    . list, clean
    
                  z     x  
      1.   .7551555     0  
      2.   .6390314   .25  
      3.   .7521452    .5  
      4.   .1362727   .75  
      5.    .903269     1  
      6.   .0940683     .  
      7.   .5745703     .  
      8.   .3728877     .  
      9.   .2738741     .  
     10.   .3902709     .

    Comment


    • #3
      Thank you! The issue is now resolved

      Comment

      Working...
      X