Dear all,
I would like to know your opinion about the following issue: I need to create (starting from my original dataset) a series of 'fictious datasets' in which I simulate another scenario changing the distribution of a given characteristics, and then calculating (for each 'fictious dataset') the correlation matrix to see if it consistent with the one I have in the original dataset
For example, In my date I have the 20% of female and 80% of male, and I want to obtain that they are 50% and 50%.
I proceeded as follows:
- calculating the weight (50/80 for male, 50/20 for female)
- creating a new variable that assigns the value 50/80 to male and 50/20 to female
- running the code "corr soldi donna [fweight=weight]", with weight being the variable which contains the weights for male and female
Anyway, Stata gives me an error stating "may not use noninteger frequency weights", where I am wrong? Is not that the kind of weight I need to do this procedure?
Thanks a lot, best, G.
Related Posts with Assigning more weight to a category of a variable
eteffects vs ermHello everyone I am a sort of beginner applying causal inference and the potential outcome framewor…
How to use a bar chart to rank states based on their fixed effects?Stata version used: Stata 15.1 Dear Ladies and Gentlemen, I am currently conducting a conditional …
Programming question about the sum of each ID and specific periodAfter many frustrated days without any result to calculate the cumulative abnormal return, I need so…
Create directory using localsDear all, I want to create a directory using a local I want to iterate through. More specifically, …
Plotting the cumulative incidence function in the presence of competing risksHi, I am analysing a small trial where the primary outcome is time to event (recovery). All individ…
Subscribe to:
Post Comments (Atom)
0 Response to Assigning more weight to a category of a variable
Post a Comment