I am trying to run a simulation on a dataset that contains user reviews. I have a selected a random subsample of 100,000 observations and I would like to create a new userid for these observations. Each userid should be tied to 10 observations, resulting in 1000 total users with each having 10 reviews 'under their belt'. As I previously, mentioned a userid already exists but I would like to create a new one for the sake of the simulation. How would I go about doing this?
Also, here is a screenshot that better illustrates what I am trying to do: https://imgur.com/a/xoIcdSo
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str17 userid double rating "JwJo4RH2HW" 4 "7oazNLenTf" 4 "y2N9JaJfRz" 5 "ypLukZm71m" 5 "3i9sx2CUnI" 5 "JgFagM5AmQ" 4 "BkQiAqZwWL" 4 "a5LQB3DDhI" 4.5 "98qoOPf4a3" 2 "PiArsx90NW" 5 "TqQbNpjUoZ" 2.5 "ffPt3sBvTk" 5 "musrHV09iR" 4.5 "9DodB4LxYy" 5 "YNxjHi7G35" 5 "SfUr5MxJb1" 4 "5w3PKVR6Qw" 5 "rqQ5OKZQ71" 4.5 "AwQZ8KTZnb" 3 "89TTbMdmWi" 3.5 "Y3gIeiBdiC" 4 "Fxw6A4wu89" 5 "AafCtzZEIu" 5 "Ay7g3XGP9Z" 3 "WhMSNMJ2Fd" 3 "ICbEYFatdW" 3 "MS5Hg5cbiy" 4.5 "PaXUnlH6xk" 1 "W6Hnz9yUD7" 5 "B3AQlDjbWf" 4 "TsRE4o3AiR" 3 "ZhoohOqaes" 3 "sbxQxxc7so" 2 "elEnaJdtYy" 5 "igvVLWRnBC" 2.5 "NAvaUOfegm" 5 "XyBqqMLRiy" 1 "ZcnkHHQsyt" 4 "kLgdHPfR33" 2.5 "qUarbU1zLC" 4 "mKvHsKUTBv" 5 "HXRd7YQXxu" 5 "DPWbaUY6XJ" 4 "bFKqVLcCWf" 5 "yaJXD0lNFL" 5 "xbJU71AJqQ" 5 "bA58frI1AA" 2 "dQYvCieSht" 5 "XukyYZ36h2" 3 "Iap65gxtFn" 4 "FWCkgaTDXk" 3 "OMZlyyiWai" 5 "PidhLzCJbk" 3 "2zkh6WGk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