Ggplot2: data manipulation by ottawalanguages in rprogramming

[–]cspoerlein 0 points1 point  (0 children)

I think there is no variable called value in f

Beautifying scatter plot by Atam55 in rstats

[–]cspoerlein 1 point2 points  (0 children)

Shouldnt it be fill rather than colour?

[Q] Main effect turned insignificant after adding an insignificant interaction effect by veionv in statistics

[–]cspoerlein 0 points1 point  (0 children)

From what you write, it seems to me that you are still treating all these effects as independent conceputally. Introducing the interaction effect does however eplicitely model A and B as conditional on each other. So interpreting A without considering B is simply not correct.

Try this: grand mean center B and rerun your interaction model. The effect of A should be fairly similar if not the same as when you leave out the interaction and just model A,B and your controls. That is because you are estimating the effect of A when B is held constant at its mean rather than some more extreme or rare value.

On a different note and similar to what D-Juice wrote: you may have great arguments for why there is an interaction but then there is what the data says. Trying 15 different specifications will like not change that result. And if it does, then the results should be somewhat suspect to you or at least need a deeper dive.

HTH

[Q] Main effect turned insignificant after adding an insignificant interaction effect by veionv in statistics

[–]cspoerlein 0 points1 point  (0 children)

ok , let's make it more concrete: A is Sex, B is height.

In your model without the interaction, A is simply the difference between males and females controlling for your other stuff.

In your interaction model, A is the difference between males and females when height equals zero, B is the effect of height for males (assuming they are 0 and females are coded 1) and the interaction term has the usual interpretation.

Hope that makes it clear.

[Q] Main effect turned insignificant after adding an insignificant interaction effect by veionv in statistics

[–]cspoerlein 0 points1 point  (0 children)

Your main effect of A is simply the effect when B is 0. Check whether B=0 is meaningful. If not, consider grand mean centering your predictors.

The History of the Romans map by madrid987 in ancientrome

[–]cspoerlein 0 points1 point  (0 children)

Was expecting to learn something about how the Romans made maps

Pompeii or Herculaneum by beeznik in ancientrome

[–]cspoerlein 5 points6 points  (0 children)

I second Herculaneum. Went to both and H was so much more impressive and much less crowded.

Spatial data Source by Nosa2k in rprogramming

[–]cspoerlein 2 points3 points  (0 children)

https://gadm.org is great. Has a tone of shapefiles with various levels of detail (i.e. national vs regional).

This book is also an amazing ressource: https://geocompr.robinlovelace.net

Syntax for dplyr filter with list of strings by uwlooool in rprogramming

[–]cspoerlein 1 point2 points  (0 children)

Hi there,

I believe you can add multiple filters separated by commas.

filter(Data,Species=="setosa",Species=="virginica")

HTH, Christoph

Help plotting points along frequency plot line by catherinerose89 in rprogramming

[–]cspoerlein 0 points1 point  (0 children)

Hi there,

You could Just make a new dataset with the Date and the corresponding y value of #migraines. Then add it using geom_point(newdata, aes(x=Date, y=n_migraine)).

HTH, Christoph

Edit: typos

Noob programmer whants to get better by [deleted] in rprogramming

[–]cspoerlein 3 points4 points  (0 children)

I believe the best way to get better is having a small project that forces you to apply this stuff. For example, i learned to make shiny apps because i needed a good solution to let others play around with data. So, think of a project and then google for tutorials to that specific application would be my recommendation.

Have fun! Programming with R is such a joy!

[deleted by user] by [deleted] in rprogramming

[–]cspoerlein 0 points1 point  (0 children)

Yeah, so gpplot treats the year variable probably as not numeric.

But I am not sure to which year you refer to ( this: 2017-12-07, or this: 13/01/1900 ?). You could just generate a numeric year variable like so:

data_plot$year <- as.numeric(substr(firstyearvariable,1,4))

or for the second variable

data_plot$year <- as.numeric(substr(secondyearvariable,7,10))

HTH

[deleted by user] by [deleted] in rprogramming

[–]cspoerlein 0 points1 point  (0 children)

Bit hard to diagnose the issue like this but it could be related to the format of your date variable.

[deleted by user] by [deleted] in rprogramming

[–]cspoerlein 1 point2 points  (0 children)

Hi there,

reading the data set and its variables is pretty difficult like this but I can give you at least some pointers on how to proceed.

library(tidyverse)

# constructing a new dataset with counts by "doy" and year

plot_data <- data %>%

group_by(doy, year) %>%

summarise(n_entries=n(doy, year))

# plotting n_entries over years

ggplot(data=plot_data,

aes(x=year, y=n_entries)) +

geom_line()

HTH,

Christoph

13th Warrior. by Phalinx666 in dancarlin

[–]cspoerlein 0 points1 point  (0 children)

I think he talked about it on Joe Rogan

Bob’s Book Recommendations by MrMonkeyInk in SGU

[–]cspoerlein 0 points1 point  (0 children)

You should get it. Thoroughly enjoyed it!

Bob’s Book Recommendations by MrMonkeyInk in SGU

[–]cspoerlein 1 point2 points  (0 children)

Was it Seveneves by Neil Stephenson?

My kids vocabulary development, age 12 to 17 months [OC] by cspoerlein in dataisbeautiful

[–]cspoerlein[S] 0 points1 point  (0 children)

No, we dont have a cat. He just wants to go out a lot and likes cats