-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintro.Rmd
91 lines (72 loc) · 2.32 KB
/
intro.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
title: "Intro"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Midex Model
Documento introduttivo sulll'utilizzo di modelli multilivello per migliorare una previsione
## Inizializzazione
*Inizializza l'ambiente cancellando tutto
```{r}
rm(list=ls())
```
*imposta le directory del progetto sostituendo il tuo path
```{r}
mydir <- "C:/Users/.../mixedmodel/"
```
*imposta le sottocartelle per i file ricevuti e prodotti. __I file originali vanno messi nella cartella _datain_ di mixedmodel.__
```{r}
mydirdi <- paste0(mydir,"datain/")
mydirdo <- paste0(mydir,"dataout/")
```
*setta la cartella di lavoro
```{r eval=FALSE}
setwd(mydir)
```
## Apertura file
*carica i file
```{r eval=FALSE}
spp <- read.csv(paste0(mydirdi,'SPEET_POP_PLUS.csv'))
degree <- read.csv(paste0(mydirdi,'SPEET_DEGREE_INFORMATION.csv'))
```
*visualizza le prime righe
```{r eval=FALSE}
table(degree)`
```
## Description instructions
```{r eval=FALSE}
table(degree_desc)
summary(degree_desc)
factor (degree_desc$SCOREIMPROVEMENT)
levels(degree_desc$NUMBERATTEMPTSTOBEEVALUATEDONEYEAR)
class(degree_desc)
names(degree_desc)
str(exams_passed_aggr)
```
## Instructions for EXAMS tables
```{r eval=FALSE}
#valutazione esami
stud <- exams_passed_aggr[which(exams_passed_aggr$CARR_AN_ID == 307342),]
stud_fallimenti <- exams_not_passed_aggr[which(exams_not_passed_aggr$CARR_AN_ID == 307342),]
stud_2010 <- subset (exams_passed_aggr, exams_passed_aggr$CARR_AN_ID == 307342
& exams_passed_aggr$STUD_ATTFRM_FRQ_AA==2010
& exams_passed_aggr$TIPO_AGGREGAZIONE =='A')
stud_2011_1sem <- subset (exams_passed_aggr, exams_passed_aggr$CARR_AN_ID == 307342
& exams_passed_aggr$STUD_ATTFRM_FRQ_AA==2011
& exams_passed_aggr$TIPO_AGGREGAZIONE =='S'
& exams_passed_aggr$STUD_ATTFRM_FRQ_SEM ==1)
stud_pass <- stud_2010
stud_pass <- append(stud_2011_1sem, )
```
## Remove duplicated elements
```{r eval=FALSE}
exams_aggr_year_sel <- unique(exams_aggr_year_sel)
```
## Instructions for MOBILITY table
```{r eval=FALSE}
#there's no mobility on first years
my_mob<-merge(mobility, careers, by.x = c('CARR_AN_ID', 'SI_CNT_AA'), by.y = c('CARR_AN_ID', 'CARR_INGR_AA'))
a<-transform(a, pl= a$CARR_INGR_AA+1)
```