the
sobra
the
sobra
risk.table=T, pval=TRUE, pval.method=T
pasaría todo a TRUE
T
ya que pones FALSE pondría TRUE
(see ?lung for a detailed description)
quizás quitaría esto ya que te dará más espacio en la diapo y ellos ya lo saben hacer
head(lung)
para hacer lo que dice Cristian, en el cambio anterior de poner el lung en esta diapo, puedes poner head(lung, 3 o 4)
,
sobra
to
sobra
pcb$platelet
Sugerencia: usar el dplyr para hacer este paso
named it model1
called model1 / named model1 o si es una instrucción: name it model2
named it model2
called model1 / named model1 o si es una instrucción: name it model2
Which
What
to
with
T
ya que pones FALSE pondría TRUE siempre también
c(3*12)
dejaría 3*12 sin "c()"
survminer
lo mismo aquí
survival
en vez de {} pondría survival
.
añadiria: or use the r"(path)" function
Tomorrow
Friday
smoking in dying.
smoking and death?
with
with the
number of observations, AIC, etc
pondría 2 columnas aquí también, así podrás poner el tamaño del código igual a las otras diapos
allow
allowed
ggplot(regicor, aes(x=age, y=sbp))+ theme_bw() + geom_point() + xlab("Age") + ylab("Systolic blood pressure")+ geom_smooth(method='lm', formula= y~x)
2 columnas aquí también para que no tengas múltiples instrucciones en la misma línea y el theme_bw() en último para seguir el orden de ideas que explicó Pau
library(ggplot2) ggplot(regicor, aes(x=age, y=sbp))+ geom_point() + xlab("Age") + ylab("Systolic blood pressure") + theme_bw()
para que se vea mejor usaría 2 columnas. Una con el código y otra con el plot
stablishes
establishes
**13.** Given last model, plot the predicted probabilities of diabetes according to glucose and BMI. ::: {.cell} ```{.r .cell-code} df$pred <- predict(m5, type="response", data=df) library(ggplot2) ggplot(df, aes(x = glucose, y = pred, color = bmi_cat)) + geom_smooth(se = FALSE) + theme_bw()+ ylab("Predicted probability of diabetes") + xlab("Glucose") + # Add lab to x-axis labs(color = "Obese") + # Change legend title theme(legend.position = "top") # Move legend to the top
Pasa algo con el formato del código
m5 <- glm(diabetes ~ glucose + bmi_cat + age, data=df, family=binomial) m5 |> tbl_regression(exponentiate=T)
Lo mismo que antes. Solución con el enunciado
using BMI categorize instead of BMI linear.
using categorized BMI instead of linear BMI.
.
doble punto
used
use
m4 <- glm(diabetes ~ glucose + mass + age, data=df, family=binomial)
Lo mismo que antes. Solución con el enunciado
an other
another
m3 <- glm(diabetes ~ glucose, data=df, family=binomial)
Lo mismo que antes. Solución con el enunciado
Install package mlbench and store PimaIndiansDiabetes data in an object call df.
Install the mlbench package and store the ... called df.
#regression model m2 <- lm(chol ~ sbp + sex, data=regicor) m2 |> tbl_regression(intercept=T)
Lo mismo que antes. Solución con el enunciado
#Number of variables: ncol(regicor)
Mejor que cada solución acompañe el enunciado. Por ejemplo esto debe ir debajo del enunciado 2 a).
#dependent variable: chol #independent variable: sbp
Lo mismo que antes. Solución con el enunciado
.
quizás añadir: or using the r"(...)" function
ANOVA IS A LINEAR MODEL
Emoji de risa: 😂
means
Leyenda pequeña
results_anova_rm$term<-c("Group","Residuals","Time","Residual") names(results_anova_rm)<-c("Stratum","Term","df","SS","MSQ","F","P-value")
Aquí lo mismo de antes:
results_anova_2w <- broom::tidy(model_anova_2w)
results_anova_2w <- results_anova_2w |> mutate(term = c("Between-groups: Dose","Between-groups: Supp","Interaction","Within-groups")) |> setNames(c("Terms","df","SS","MSQ","F","P-value"))
data
Título de cada gráfico más grande
In dependent
leyenda del gráfico más grande
labs(x = "Dose", y = "Estimated Marginal Mean", color = "Supplement")
aumentar el tamaño de la leyenda
as.data.frame(emm) |> ggplot(aes(x = dose, y = emmean, color = supp, group = supp)) +
lo mismo, mejor poner:
ggplot(as.data.frame(emm), aes(x = dose, y = emmean, color = supp, group = supp))
results_anova_2w <- broom::tidy(model_anova_2w) results_anova_2w$term<-c("Between-groups: Dose","Between-groups: Supp","Interaction","Within-groups") names(results_anova_2w)<-c("Terms","df","SS","MSQ","F","P-value")
esto va a ser un poco friky, pero lo han aprendido de la siguiente forma:
results_anova_2w <- broom::tidy(model_anova_2w)
results_anova_2w <- results_anova_2w |> mutate(term = c("Between-groups: Dose","Between-groups: Supp","Interaction","Within-groups")) |> setNames(c("Terms","df","SS","MSQ","F","P-value"))
he usado el setNames para que no te ocupe 50 líneas con el rename() pero es importante decir que hace el cambio de nombres por posición de cada columna
as.data.frame(emm) |> ggplot( aes(x = dose, y = emmean, ymin = lower.CL, ymax = upper.CL))
se van a liar con esto porque mezcla pipes con el "+" del ggplot, mejor:
ggplot(as.data.frame(emm), aes(x = dose, y = emmean, ymin = lower.CL, ymax = upper.CL))
# A tibble: 6 × 3
Quizás poner el gráfico un poco más grande
ow
how
factors or more…
Leyenda se ve muy pequeña
Plot
Línea siguiente vacía
Analysis of Variance
Los gráficos de la izquierda sale pequeños
true is .
falta el valor
stat_qq() + stat_qq_line() +
en la sesión anterior hemos usado: geom_qq() + geom_qq_line() +
At
Hay un espacio demás
Bartlett’s tes.
test
.
Falta el valor
.
Falta el valor
Check the age of the 20th subject. Find the values of the age that are greater than 100.
Check the age: a) for the 20th subject b) Find the values greater than 100
for the age. Repeat for the height.
for age and height (tal vez poner age y height en negrita)
View the data in a data viewer window
Quizás incluir head() y tail()
Count the number of missings that has the height.
Check the number of missing values in the height variable
Check the structure of the data. What class is the object? What class are the vectors stored in its columns? How many rows and columns does the data have?
Quizás poner cada punto como diferentes ejercicios: a) What class.... b) ... c)
You can use
Cambiar a "Use the ..."
From the database, filter and select the database that contains the ID, age, sex, and time to exitus of the patients, sorted by time to exitus.
Filter the database created in Exercise 12 according to the previous condition and select the columns containing ID, age, sex and time to exitus of the patients. Then sort it by time to exitus.
outcome of the subjects
subjects study outcomes.
Applied Biostatistics Course with R
Afegir data
how many
Ho volem amb counts o amb percentatges? o ambdós?
called
file
an
as an
subjects have obesity
people are obese.
Exercices
Exercises
that
A la fòrmula posar meters
values of the age that are greater than 100
Potser posaria un tip...
% 9
añadiria: with a ...
T
Falta un <br> para que corresponda con el siguiente slide
La CIA
castellano
samplig
sampling
: is a
lo mismo
:
Esto o sobra o debería ser: Population: set of elements...
From the database, filter and select the database that contains the ID, age, sex, and time to exitus of the patients, sorted by time to exitus.
Filter the database created in Exercise 12 according to the previous condition and select the columns containing ID, age, sex and time to exitus of the patients. Then sort it by time to exitus.
Count the number of missings that has the height.
Check the number of missing values in the height variable
You can use
Cambiar a "Use the ..."
Check the structure of the data. What class is the object? What class are the vectors stored in its columns? How many rows and columns does the data have?
Quizás poner cada punto como diferentes ejercicios: a) What class.... b) ... c)