Hi all,
I am wondering if anyone has any ideas on how I can compare each observation from one variable to every observation in another variable. Essentially, imagine you have 10 observations in one variable A, and then another 1000 in another variable B. For each observation in variable A, I would like to compare it to every value in variable B. In reality, I have over 300,000 observations for each variable, so the computation becomes cumbersome quickly.
I have currently figured out the problem in Python, but it takes over 2 minutes to run through 300 observations (or roughly 10ish hours for the whole dataset). The algorithm is straightforward enough in Python - fix variable 1, compare to every observation in variable 2; fix variable 2, compare to every observation in variable 2, etc., etc... Is there anything in Stata a bit more sophisticated?
I am currently using StataIC 15 on MacOS.
Related Posts with Comparing each observation from one variable to few hundred thousand in another
Reshaping data from long to wide formDataex input float(machine u_i control u_ij replicate e_ijk IUg mach1 MC MCR) byte(_Imach1_1 _Icont…
How to save subsets of a variable ? Code: * Example generated by -dataex-. To install: ssc install dataex clear input str6 id byte(inde…
Looping egen mean weightHi all, I am supposed to get a single mean_weight variable. Original egen code: egen weight_mean =…
Finding and encoding previous experienceDear all, I have a question that I have been struggling with in the past few days. I have read the …
Survival Analysis using Nigeria Demographic and Health Survey dataPlease everyone I have this challenge with setting up my data for survival analysis to study under-5…
Subscribe to:
Post Comments (Atom)
0 Response to Comparing each observation from one variable to few hundred thousand in another
Post a Comment