Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
T
typeIvsII
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de conteneur
Registre de modèles
Opération
Environnements
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Conditions générales et politique de confidentialité
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
RShiny_UCLouvain
typeIvsII
Validations
298c1756
Valider
298c1756
rédigé
5 years ago
par
Eugen Pircalabelu
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Upload New File
parent
f81403d8
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
server.r
+103
-0
103 ajouts, 0 suppression
server.r
avec
103 ajouts
et
0 suppression
server.r
0 → 100644
+
103
−
0
Voir le fichier @
298c1756
# Define a server for the Shiny app
function
(
input
,
output
)
{
# Fill in the spot we created for a plot
output
$
Plot
<-
renderPlot
({
myalpha1
=
input
$
alpha
mu0
=
input
$
mu0
sigma
=
input
$
sigma
n
=
input
$
n
mu1
=
input
$
mu1
criterion
=
qnorm
(
1
-
myalpha1
)
*
sigma
/
sqrt
(
n
)
+
mu0
# criterion c
betamu
=
pnorm
((
sqrt
(
n
)
/
sigma
)
*
(
mu0
-
mu1
)
+
qnorm
(
1
-
myalpha1
))
#beta
power
=
1
-
pnorm
((
sqrt
(
n
)
/
sigma
)
*
(
mu0
-
mu1
)
+
qnorm
(
1
-
myalpha1
))
# power
par
(
mar
=
c
(
4
,
0
,
4
,
0
))
# distribut under null \bar{X}~N(mu0,sig/\sqrt{n})
plot
(
seq
(
-3
,
3
,
length
=
1000
),
dnorm
(
seq
(
-3
,
3
,
length
=
1000
),
mu0
,
sigma
/
sqrt
(
n
)),
type
=
"l"
,
lwd
=
1
,
ylim
=
c
(
0
,
max
(
dnorm
(
seq
(
-3
,
3
,
length
=
1000
),
mu0
,
sigma
/
sqrt
(
n
)))
+0.2
),
cex.lab
=
2.2
,
xlab
=
""
,
main
=
""
,
ylab
=
""
,
cex
=
1.4
,
cex.axis
=
2
,
bty
=
"n"
,
xlim
=
c
(
-5
,
6
),
yaxt
=
"n"
,
xaxt
=
"n"
,
col
=
"black"
)
lines
(
seq
(
-3
,
5
,
length
=
1000
),
dnorm
(
seq
(
-3
,
5
,
length
=
1000
),
mu1
,
sigma
/
sqrt
(
n
)),
type
=
"l"
,
lwd
=
1
,
ylim
=
c
(
0
,
1.5
),
cex.lab
=
2.2
,
xlab
=
""
,
main
=
""
,
ylab
=
""
,
cex
=
1.4
,
cex.axis
=
2
,
bty
=
"n"
,
xlim
=
c
(
-5
,
7
),
yaxt
=
"n"
,
xaxt
=
"n"
,
col
=
"black"
)
abline
(
v
=
criterion
,
lty
=
1
,
lwd
=
3
,
col
=
"red"
)
axis
(
1
,
c
(
-5
:
5
),
cex.axis
=
2
,
tck
=
-.02
)
mtext
(
expression
(
bar
(
X
)[
n
]),
at
=
c
(
0
),
side
=
1
,
line
=
3
,
cex
=
2
)
left
<-
seq
(
-3
,
criterion
,
length.out
=
100
)
right
<-
seq
(
criterion
,
3
,
length.out
=
100
)
yH0r
<-
dnorm
(
right
,
mu0
,
sigma
/
sqrt
(
n
))
yH1l
<-
dnorm
(
left
,
mu1
,
sigma
/
sqrt
(
n
))
yH1r
<-
dnorm
(
right
,
mu1
,
sigma
/
sqrt
(
n
))
polygon
(
c
(
right
,
rev
(
right
)),
c
(
yH0r
,
numeric
(
length
(
right
))),
border
=
NA
,
density
=
5
,
lty
=
3
,
lwd
=
4
,
angle
=
-45
,
col
=
"black"
)
polygon
(
c
(
left
,
rev
(
left
)),
c
(
yH1l
,
numeric
(
length
(
left
))),
border
=
NA
,
density
=
5
,
lty
=
3
,
lwd
=
4
,
angle
=
45
,
col
=
"black"
)
polygon
(
c
(
right
,
rev
(
right
)),
c
(
yH0r
,
numeric
(
length
(
right
))),
border
=
NA
,
col
=
rgb
(
1
,
0.3
,
0.3
,
0.6
))
polygon
(
c
(
left
,
rev
(
left
)),
c
(
yH1l
,
numeric
(
length
(
left
))),
border
=
NA
,
col
=
rgb
(
0.3
,
0.3
,
1
,
0.6
))
text
(
criterion
-1.5
,
max
(
dnorm
(
seq
(
-3
,
3
,
length
=
1000
),
mu0
,
sigma
/
sqrt
(
n
)))
+0.2
,
adj
=
0
,
label
=
as.expression
(
bquote
(
c
~
"="
~
.
(
format
(
criterion
,
digits
=
3
)))),
cex
=
1.5
)
text
(
-2.5
,
0.3
*
max
(
dnorm
(
seq
(
-3
,
3
,
length
=
1000
),
mu0
,
sigma
/
sqrt
(
n
)))
,
adj
=
1
,
label
=
expression
(
"Distrib. sous "
*
H
[
0
]),
cex
=
1.5
)
text
(
mu1
+4
,
0.3
*
max
(
dnorm
(
seq
(
-3
,
13
,
length
=
1000
),
mu0
,
sigma
/
sqrt
(
n
))),
adj
=
1
,
label
=
expression
(
"Distrib. sous "
*
H
[
a
]),
cex
=
1.5
)
text
(
-2.5
,
0.2
*
max
(
dnorm
(
seq
(
-3
,
3
,
length
=
1000
),
mu0
,
sigma
/
sqrt
(
n
))),
adj
=
1
,
label
=
expression
(
"N(0,"
*
sigma
/
sqrt
(
n
)
*
")"
),
cex
=
1.5
)
text
(
mu1
+4
,
0.2
*
max
(
dnorm
(
seq
(
-3
,
3
,
length
=
1000
),
mu0
,
sigma
/
sqrt
(
n
))),
adj
=
1
,
label
=
expression
(
"N(1,"
*
sigma
/
sqrt
(
n
)
*
")"
),
cex
=
1.5
)
source
(
"http://www.math.mcmaster.ca/bolker/R/misc/legendx.R"
)
legend
(
"topright"
,
c
(
as.expression
(
bquote
(
alpha
[
n
](
mu
)
~
"="
~
.
(
format
(
myalpha1
,
digits
=
3
)))),
as.expression
(
bquote
(
beta
[
n
](
mu
)
~
"="
~
.
(
format
(
betamu
,
digits
=
3
))))),
text.col
=
"white"
,
col
=
c
(
NA
,
NA
,
NA
),
lty
=
c
(
NA
,
NA
,
1
),
border
=
c
(
"#FF4D4D99"
,
"#4D4DFF99"
,
NA
),
fill
=
c
(
rgb
(
1
,
0.3
,
0.3
,
0.6
),
rgb
(
0.3
,
0.3
,
1
,
0.6
),
NA
),
cex
=
1.5
,
bty
=
"n"
,
angle
=
c
(
-45
,
45
,
90
),
box.cex
=
c
(
2
,
2
),
y.intersp
=
3
)
legend
(
"topright"
,
c
(
as.expression
(
bquote
(
alpha
[
n
](
mu
)
~
"="
~
.
(
format
(
myalpha1
,
digits
=
3
)))),
as.expression
(
bquote
(
beta
[
n
](
mu
)
~
"="
~
.
(
format
(
betamu
,
digits
=
3
))))),
text.col
=
"white"
,
col
=
c
(
NA
,
NA
,
NA
),
lty
=
c
(
2
,
2
,
NA
),
border
=
c
(
"#FF4D4D99"
,
"#4D4DFF99"
,
NA
),
fill
=
c
(
rgb
(
1
,
0.3
,
0.3
,
0.6
),
rgb
(
0.3
,
0.3
,
1
,
0.6
),
NA
),
cex
=
1.5
,
density
=
c
(
10
,
10
,
0
),
bty
=
"n"
,
angle
=
c
(
-45
,
45
,
90
),
box.cex
=
c
(
2
,
2
),
y.intersp
=
3
)
legend
(
"topright"
,
c
(
as.expression
(
bquote
(
alpha
[
n
](
mu
)
~
"="
~
.
(
format
(
myalpha1
,
digits
=
3
)))),
as.expression
(
bquote
(
beta
[
n
](
mu
)
~
"="
~
.
(
format
(
betamu
,
digits
=
3
))))),
text.col
=
"black"
,
col
=
c
(
NA
,
NA
,
NA
),
lty
=
c
(
3
,
3
,
NA
),
border
=
c
(
"#FF4D4D99"
,
"#4D4DFF99"
,
NA
),
cex
=
1.5
,
density
=
c
(
10
,
10
,
0
),
bty
=
"n"
,
angle
=
c
(
-45
,
45
,
90
),
box.cex
=
c
(
2
,
2
),
y.intersp
=
3
)
})
}
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter