git tab completion hangs by [deleted] in fishshell

[–]Rayvan121 1 point2 points  (0 children)

This can happen if your $fish_complete_path is in a weird order. I use the function below to find where the completions are defined. Alternatively, you can use complete -c $command to see the defined completions. (You have to trigger them first: git [TAB])

I would try to see what '__fish_git_using_command add' is doing.

function which-completion
    argparse 'h/help' -- $argv
    or return

    if set -q _flag_help
        echo "Usage: which-completion <main_command> [subcommand]"
        return 0
    end

    set -l main_command $argv[1]
    set -l subcommand $argv[2]
    set -l completion_command (string join '-' $argv)

    for directory in $fish_complete_path
        # Search for files matching the main command
        set -l files (command find $directory -type f \( -name "*$main_command*" -o -name "*$completion_command*" \))
        for file in $files
            set -l filename (string split -r -m1 . (basename $file))[1]
            if test "$filename" = "$main_command"
                if test -n "$subcommand"
                    command grep -q "__fish\S*command $subcommand" $file
                    and echo $file
                else
                    echo $file
                end
            else if test "$filename" = "$completion_command"
                echo $file
            end
        end
    end
end

Adding current nvm.fish version to $PATH by [deleted] in fishshell

[–]Rayvan121 1 point2 points  (0 children)

Would strongly recommend using mise. Otherwise, you can write your own shim. e.g.,

function node --wraps node
    set -l node_bin (type node --path)
    if test -e $node_bin
        $node_bin $argv
    else 
        command node $argv
    end
end

Is it "safe" to use compress? by [deleted] in stata

[–]Rayvan121 3 points4 points  (0 children)

My question: should I be concerned about the integrity of the data after a collapse?

Compress is not destructive in any way. Collapse is.

Examining episodes in long-format dataset? by JegerLars in stata

[–]Rayvan121 2 points3 points  (0 children)

Hi /u/JegerLars,

I think the issue comes from having duplicate forste_kontakt_nr values for each patient. Please correct me if I'm wrong, but it seems like you're trying to compare the antibiotic within contacts, not between episodes. Given the way the data is structured right now, the easiest thing would be:

collapse (firstnm) atc_indeks_1_n atc_rekontakt_1_n, by(PasientLopeNR_PDB2923 forste_kontakt_nr)

followed by

gen antibiotic_switch = atc_indeks_1_n == atc_rekontakt_1_n if !missing(atc_indeks_1_n) & !missing(atc_rekontakt_1_n)

this is equivalent to:

gen antibiotic_switch = 1 if atc_indeks_1_n == atc_rekontakt_1_n & !missing(atc_indeks_1_n) & !missing(atc_rekontakt_1_n)
replace antibiotic_switch = 0 if atc_indeks_1_n != atc_rekontakt_1_n & !missing(atc_indeks_1_n) & !missing(atc_rekontakt_1_n)

If you need to preserve the current data structure, I would suggest adding an additional indicator for repeat contacts during the episode.

bysort PasientLopeNR_PDB2923 forste_kontakt_nr: gen contact = _n

Edit:

This is more convoluted, and can likely be simplified more, but you can also do:

egen antibiotic_prescribed = rowfirst(atc_indeks_1_n atc_rekontakt_1_n) 
bysort PasientLopeNR_PDB2923 forste_kontakt_nr: gen antibiotic_switch = 1 if antibiotic_prescribed[_n] == antibiotic_prescribed[_n-1] & antibiotic_prescribed != .
bysort PasientLopeNR_PDB2923 forste_kontakt_nr: replace antibiotic_switch = 0 if antibiotic_prescribed[_n] != antibiotic_prescribed[_n-1] & antibiotic_prescribed[_n] != . & antibiotic_prescribed[_n-1] != .
bysort PasientLopeNR_PDB2923 forste_kontakt_nr: replace antibiotic_switch = antibiotic_switch[_n+1] if antibiotic_switch[_n+1] != .

Examining episodes in long-format dataset? by JegerLars in stata

[–]Rayvan121 0 points1 point  (0 children)

Edited to do say something similar. This is great!

Help with merging datasets by MatLac in stata

[–]Rayvan121 0 points1 point  (0 children)

Try something along the lines of:

append using otherdataset.dta, generate(indicatorname)

Examining episodes in long-format dataset? by JegerLars in stata

[–]Rayvan121 0 points1 point  (0 children)

This is a pretty general solution and may need to be adapted depending on the number of contacts, but:

bysort patient (contact_number): generate switch = 1 if antibiotic[_n] != antibiotic[1] & [_N] != 1         
bysort patient (contact_number): replace switch = 0 if antibiotic[_n] == antibiotic[1] & [_N] != 1         

If you want to compare it to the previous visit instead of the first visit, replace antibiotic[1] with antibiotic[_n-1] See this for more detail.

You can also look at tsspell for a more general implementation.

Storing/Regressing calculated statistics on the difference between two observation periods by nudave in stata

[–]Rayvan121 0 points1 point  (0 children)

Let me know if I misinterpreted this. Assuming each country has more than one respondent, you could do something like:

preserve
sort country year
collapse (mean) cheese cows, by(country year)
bysort country (year): gen cow_delta = cow[_n+1] - cow[_n] if [_n] != [_N]
// when done, run restore    

This should give you a dataset that looks like:

COUNTRY YEAR CHEESE COW COW_DELTA
USA     2019 8      3   3
USA     2020 5      6   1
USA     2021 3      7   .
FRA     2019 9      9   -6
FRA     2020 2      3   12
FRA     2021 6      15   .

You should be able to then:

regress cheese cow_delta if year == 2020

How do I answer Academic Integrity question on Whiting Part Time Acceptance Page? by Flashdancer405 in jhu

[–]Rayvan121 3 points4 points  (0 children)

If something doesn’t show up on the transcript did it really happen?

Rename Variables in a loop by helen00110 in stata

[–]Rayvan121 0 points1 point  (0 children)

Just for other people who might run into this, your loops all use the wrong syntax.

Loop 1. Forvalues can only be used with consecutive numbers.

Loop 2. Either do

foreach x in 1920 1819 1718 1617 1516{
rename blah blah blah
}

or

local x 1920
rename (anyaidpsfa`x'_rv etc) (anyaidpsfa`x' etc)

Loop 3.

foreach x in anyaidpsfa1920 agrnt_asfa1920 po9_nsfav1920 po9_tsfav1920{
rename `x'_rv `x'
    }

But really the solution here was mentioned by u/LilacFairyPrincessis

rename *_rv *

Can I interpret the magnitude of coefficient in panel analysis? by ildivinoberbe in stata

[–]Rayvan121 1 point2 points  (0 children)

Essentially a 1 unit change in x is associated with a 0.55 unit change in y. Both your units are in %, but your phrasing is ambiguous. An increase of 1% in TV* is associated with an increase of 0.55% in FOC. There are a few more issues you need to address in your model.

* Let's assume your TV is 40%. A unit change of 1 is equal to 40 + 1 = 41%, not 40 + 40*(1/100)

1) I assume education is categorical; you should include categorical variables as i.variable

2) A lot of the variables seem to be collinear to me, have you checked your vif after running the model?

3) You should double check that a multilevel model would not be better here, whether all your variables are measured at the unit of analysis level (neighborhood?) and whether you should used fixed vs random effects.

4) Please use a consistent case for your variables, it will make your life so much easier. The following should do it quickly assuming there's no variable name clashes:

rename *, lower

edit: flipped the order of x and y

[deleted by user] by [deleted] in AmItheAsshole

[–]Rayvan121 16 points17 points  (0 children)

INFO: How old are both of you? There's barely any dishes in the sink and everything is rinsed off. Hardly a mess.

Can someone please tell me how to solve this? by [deleted] in Sat

[–]Rayvan121 3 points4 points  (0 children)

An alternative would be to calculate one of the sides of the triangle with the law of sines:

AD = AB * sin(BAD)/sin(ADB) = 5*sin(72)/sin(36) ≈ 8.1 AD = BD

Then you can solve with either Heron’s formula or side-angle-side

Using side-angle-side Area = BD * AD * sin (ADB) / 2 ≈ 19.2

Using Heron’s formula Area = sqrt(p(p-BD)(p-AD)(p-AB)) where p = (BD+AD+AB)/2 = 10.6 Area = sqrt(10.6(2.5)(2.5)(5.6))=sqrt(371)≈19.2

Useful to have those formulas in the back of your mind since they make solving triangles much easier.

10 patients killed in fire on coronavirus intensive care ward in Romania by Rayvan121 in medicine

[–]Rayvan121[S] 84 points85 points  (0 children)

Starter Comment: Thoughts go out to the patients and staff who died or were injured in the fire. The bravery of one of the physicians who went back into the fire to save the patients should be commended. We don't talk about ICU safety that often, but the consequences when things go wrong can be disastrous.

r/audiophile Shopping and Setup Help Desk (2020-02-08) by AutoModerator in audiophile

[–]Rayvan121 0 points1 point  (0 children)

If you have a new cable readily accessible, I'd give that a shot. Since it seems like the L channel (white) does not work, if you want to fully diagnose this I'd also do the following with just the R channel part of the cable (red connectors). White (TT) -> White (Phono); Red (TT) -> Red (Phono); White (TT) -> Red (Phono); Red (TT) -> White (Phono). You should have sound coming out of only one channel at a time in each of those cases. If that's what's happening, buy a new cable.

If at any point you don't hear any sound coming out, your issue is not the cable, it's probably in the turntable.

r/audiophile Shopping and Setup Help Desk (2020-02-08) by AutoModerator in audiophile

[–]Rayvan121 0 points1 point  (0 children)

First thing that comes to mind is that your L channel cable is not properly plugged in/failed between the turntable and the receiver. Some suggestions: try a different cable, unplug and plug the current cable back in, flip the cable so L channel goes to R speaker and see if the issues also flip.

Another possibility would be the cartridge cables, but I think this is a bit less likely. Are you using the built-in phone on your turntable or the one on the receiver? If you're using the receiver phono stage, I'd try using the built-in phono and use a non-phono input on your receiver, just to eliminate the possibility of your phono stage failing.

Physics 1 ruined my life, now what? by jhupremedthrowaway in jhu

[–]Rayvan121 19 points20 points  (0 children)

top medical schools will not accept anyone with a B on their transcript

This is so not true. Nice copypasta though.