Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow frequency weights #3

Closed
mkaulisch opened this issue Jan 13, 2023 · 4 comments
Closed

Allow frequency weights #3

mkaulisch opened this issue Jan 13, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@mkaulisch
Copy link

I often work with data that is collapsed. It would be cool if frequency weights and/or importance weights would be allowed. The latter because sometimes I use frequencies with decimal numbers.

@asjadnaqvi
Copy link
Owner

that should be easy to add. if you can share a basic example of data with and without weights, i can implement it fairly fast.

@asjadnaqvi asjadnaqvi self-assigned this Jan 13, 2023
@asjadnaqvi asjadnaqvi added the enhancement New feature or request label Jan 13, 2023
@mkaulisch
Copy link
Author

Have a look at this code example - from Discord channel

cwf default
cap frame drop test
frame create test
cwf test

  • Example generated by -dataex-. For more info, type help dataex
    clear
    input double impact_p byte(field period)
    3410.16666666667 3 1
    4588.83333333333 3 7
    5502.33333333333 3 12
    365.166666666667 4 1
    543 4 7
    628.833333333333 4 12
    160.5 5 1
    136.333333333333 5 7
    172.5 5 12
    875.166666666667 6 1
    1019.33333333333 6 7
    1114.33333333333 6 12
    147 7 1
    374.5 7 7
    524 7 12
    end
    label values field l_field_kurz
    label def l_field_kurz 3 "Biomedical & health sciences", modify
    label def l_field_kurz 4 "Life & earth sciences", modify
    label def l_field_kurz 5 "Mathematics & computer science", modify
    label def l_field_kurz 6 "Physical sciences & engineering", modify
    label def l_field_kurz 7 "Social sciences & humanities", modify
    label values period l_period
    label def l_period 1 "2006–2009", modify
    label def l_period 7 "2012–2015", modify
    label def l_period 12 "2017–2020", modify
    label var impact_p "Anzahl Publikationen"
    label var field "Fächergruppe"
    label var period "Auswertungszeitraum"

**# expand to use with alluvial
expand impact_p, gen(expand_i)

**# separate field-Variable
separate field, by(period) gen(pubs_) veryshortlabel sequential

alluvial pubs_1 pubs_2 pubs_3

@mkaulisch
Copy link
Author

mkaulisch commented Jan 13, 2023

This code also generates an error code

PS: @asjadnaqvi has explained that the data in the form shown in this post: #3 (comment) - is not correct - and the error is correct.

@asjadnaqvi
Copy link
Owner

Weights added in v1.1 but need further testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants